Changeset 502 in josm for trunk/src/org/openstreetmap/josm/actions/mapmode/SelectAction.java
- Timestamp:
- 2007-12-30T23:55:51+01:00 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/mapmode/SelectAction.java
r484 r502 149 149 if (mode == Mode.rotate && affectedNodes.size() < 2) 150 150 return; 151 152 153 // check if any coordinate would be outside the world 154 for (OsmPrimitive osm : affectedNodes) { 155 if (osm instanceof Node && ((Node)osm).coor.isOutSideWorld()) { 156 JOptionPane.showMessageDialog(Main.parent, 157 tr("Cannot move objects outside of the world.")); 158 return; 159 } 160 } 151 161 152 Command c = !Main.main.undoRedo.commands.isEmpty() 162 153 ? Main.main.undoRedo.commands.getLast() : null; … … 166 157 ((MoveCommand)c).moveAgain(dx,dy); 167 158 else 168 Main.main.undoRedo.add(new MoveCommand(selection, dx, dy)); 159 Main.main.undoRedo.add( 160 c = new MoveCommand(selection, dx, dy)); 161 162 for (Node n : affectedNodes) { 163 if (n.coor.isOutSideWorld()) { 164 // Revert move 165 ((MoveCommand) c).moveAgain(-dx, -dy); 166 167 JOptionPane.showMessageDialog(Main.parent, 168 tr("Cannot move objects outside of the world.")); 169 return; 170 } 171 } 169 172 } else if (mode == Mode.rotate) { 170 173 if (c instanceof RotateCommand && affectedNodes.equals(((RotateCommand)c).objects))
Note:
See TracChangeset
for help on using the changeset viewer.