Changeset 634


Ignore:
Timestamp:
12/17/13 17:00:02 (10 years ago)
Author:
jts21
Message:

Fix image and widget panning

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/expeditee/actions/Misc.java

    r632 r634  
    4444import org.expeditee.items.Line;
    4545import org.expeditee.items.Text;
     46import org.expeditee.items.XRayable;
    4647import org.expeditee.items.widgets.InteractiveWidget;
    47 import org.expeditee.items.widgets.InteractiveWidgetInitialisationFailedException;
    4848import org.expeditee.items.widgets.JfxBrowser;
     49import org.expeditee.items.widgets.WidgetCorner;
     50import org.expeditee.items.widgets.WidgetEdge;
    4951import org.expeditee.math.ExpediteeJEP;
    5052import org.expeditee.settings.UserSettings;
     
    14731475        public static void pan(Frame frame, int x, int y) {
    14741476                for(Item i : frame.getAllItems()) {
    1475                         i.setXY(i.getX() + x, i.getY() + y);
     1477                        if(i instanceof WidgetEdge || i instanceof WidgetCorner) {
     1478                                continue;
     1479                        } else if(i instanceof XRayable) {
     1480                                i.setPosition(i.getX() + x, i.getY() + y);
     1481                        } else {
     1482                                i.setXY(i.getX() + x, i.getY() + y);
     1483                        }
    14761484                        // update the polygon, otherwise stuff moves but leaves it's outline behind
    1477                         // (maybe this should use setPosition() instead?)
    14781485                        i.updatePolygon();
     1486                }
     1487                for(InteractiveWidget iw : frame.getInteractiveWidgets()) {
     1488                        iw.setPosition(iw.getX() + x, iw.getY() + y);
    14791489                }
    14801490                // make sure we save the panning of the frame
Note: See TracChangeset for help on using the changeset viewer.