Changeset 163


Ignore:
Timestamp:
07/28/08 15:20:22 (16 years ago)
Author:
ra33
Message:

A couple of fixes to the newly added GetItemsFromChildFrame

File:
1 edited

Legend:

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

    r162 r163  
    157157                getFromChildFrame(current, false);
    158158        }
    159        
     159
    160160        public static void GetItemsFromChildFrame(Item current) {
    161161                getItemsFromChildFrame(current, false);
     
    189189                FrameGraphics.Repaint();
    190190        }
    191        
     191
    192192        private static void getItemsFromChildFrame(Item current, boolean textOnly) {
    193193                Collection<Item> items = getItemsOnChildFrame(current, textOnly);
     
    199199                // copy the item and switch
    200200                Collection<Item> copies = ItemUtils.CopyItems(items);
    201                 float deltaX = DisplayIO.getMouseX();
    202                 float deltaY = FrameMouseActions.getY();
    203                 for(Item i: copies){
    204                         i.setXY(i.getX() + deltaX, i.getY() + deltaY);
     201                Item first = items.iterator().next();
     202                float deltaX = DisplayIO.getMouseX() - first.getX();
     203                float deltaY = FrameMouseActions.getY() - first.getY();
     204                for (Item i : copies) {
     205                        if (i.isVisible())
     206                                i.setXY(i.getX() + deltaX, i.getY() + deltaY);
    205207                        i.setParent(null);
    206208                }
     
    681683                return item;
    682684        }
    683        
     685
    684686        private static Collection<Item> getItemsOnChildFrame(Item current,
    685687                        boolean textOnly) {
     
    704706                else
    705707                        body.addAll(child.getItems());
    706                
     708
    707709                return body;
    708710        }
Note: See TracChangeset for help on using the changeset viewer.