Changeset 643


Ignore:
Timestamp:
12/18/13 15:01:19 (10 years ago)
Author:
jts21
Message:

Implement cat flipping

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/expeditee/items/Picture.java

    r610 r643  
    6767
    6868        private Point _end = new Point(0, 0);
     69       
     70        private boolean _flipX = false;
     71        private boolean _flipY = false;
    6972
    7073        private boolean _showCropping = false;
     
    152155                } catch (Exception e) {
    153156                }
     157               
     158                if(size.toLowerCase().contains("flipx")) {
     159                        _flipX = true;
     160                }
     161               
     162                if(size.toLowerCase().contains("flipy")) {
     163                        _flipY = true;
     164                }
    154165
    155166                try {
     
    357368                                }
    358369                               
    359                                 g.drawImage(_image, x, y, endX, endY, cropStartX, cropStartY, cropEndX, cropEndY, _imageObserver);
     370                                System.out.println(_flipX + " " + _flipY);
     371                               
     372                                int sx = _flipX ? cropEndX : cropStartX;
     373                                int ex = _flipX ? cropStartX : cropEndX;
     374                                int sy = _flipY ? cropEndY : cropStartY;
     375                                int ey = _flipY ? cropStartY : cropEndY;
     376                                g.drawImage(_image, x, y, endX, endY, sx, sy, ex, ey, _imageObserver);
    360377                               
    361378                                cropStartY = 0;
     
    700717                        newText.append(" ").append(_end.x).append(" ").append(_end.y);
    701718                }
     719               
     720                if(_flipX) {
     721                        newText.append(" flipX");
     722                }
     723                if(_flipY) {
     724                        newText.append(" flipY");
     725                }
    702726
    703727                _source.setText(newText.toString());
     
    736760                super.scale(scale, originX, originY);
    737761        }
     762       
     763        public void setFlipX(boolean flip) {
     764                _flipX = flip;
     765        }
     766       
     767        public void setFlipY(boolean flip) {
     768                _flipY = flip;
     769        }
     770       
     771        public boolean getFlipX() {
     772                return _flipX;
     773        }
     774       
     775        public boolean getFlipY() {
     776                return _flipY;
     777        }
    738778
    739779}
Note: See TracChangeset for help on using the changeset viewer.