Changeset 748 in josm for trunk/src/org/openstreetmap/josm/command
- Timestamp:
- 2008-08-06T08:49:51+02:00 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/command/RotateCommand.java
r630 r748 63 63 this.objects = AllNodesVisitor.getAllNodes(objects); 64 64 pivot = new Node(new LatLon(0,0)); 65 65 pivot.eastNorth = new EastNorth(0,0); 66 66 67 for (Node n : this.objects) { 67 68 MoveCommand.OldState os = new MoveCommand.OldState(); … … 71 72 oldState.put(n, os); 72 73 pivot.eastNorth = new EastNorth(pivot.eastNorth.east()+os.eastNorth.east(), pivot.eastNorth.north()+os.eastNorth.north()); 73 pivot.coor = Main.proj.eastNorth2latlon(pivot.eastNorth);74 74 } 75 75 pivot.eastNorth = new EastNorth(pivot.eastNorth.east()/this.objects.size(), pivot.eastNorth.north()/this.objects.size()); 76 pivot.coor = Main.proj.eastNorth2latlon(pivot.eastNorth); 76 pivot.coor = Main.proj.eastNorth2latlon(pivot.eastNorth); 77 77 78 78 rotationAngle = Math.PI/2; … … 89 89 startAngle = Math.atan2(start.east()-pivot.eastNorth.east(), start.north()-pivot.eastNorth.north()); 90 90 double endAngle = Math.atan2(end.east()-pivot.eastNorth.east(), end.north()-pivot.eastNorth.north()); 91 rotationAngle += startAngle - endAngle; 91 rotationAngle += startAngle - endAngle; 92 92 rotateNodes(false); 93 93 } 94 94 95 95 /** 96 96 * Helper for actually rotationg the nodes.
Note:
See TracChangeset
for help on using the changeset viewer.