Changeset 4134 in josm
- Timestamp:
- 2011-06-11T00:23:38+02:00 (14 years ago)
- Location:
- trunk
- Files:
-
- 7 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/coor/EastNorth.java
r3837 r4134 25 25 public EastNorth add(double dx, double dy) { 26 26 return new EastNorth(x+dx, y+dy); 27 } 28 29 public EastNorth add(EastNorth other) { 30 return new EastNorth(x+other.x, y+other.y); 31 } 32 33 public EastNorth scale(double s) { 34 return new EastNorth(s * x, s * y); 27 35 } 28 36 -
trunk/src/org/openstreetmap/josm/gui/MapFrame.java
r4127 r4134 41 41 import org.openstreetmap.josm.actions.mapmode.ExtrudeAction; 42 42 import org.openstreetmap.josm.actions.mapmode.MapMode; 43 import org.openstreetmap.josm.actions.mapmode.ParallelWayAction; 43 44 import org.openstreetmap.josm.actions.mapmode.SelectAction; 44 45 import org.openstreetmap.josm.actions.mapmode.ZoomAction; … … 129 130 addMapMode(new IconToggleButton(new SelectAction(this))); 130 131 addMapMode(new IconToggleButton(new DrawAction(this))); 131 addMapMode(new IconToggleButton(new ExtrudeAction(this)));132 132 addMapMode(new IconToggleButton(new ZoomAction(this))); 133 133 addMapMode(new IconToggleButton(new DeleteAction(this))); 134 addMapMode(new IconToggleButton(new ExtrudeAction(this))); 135 addMapMode(new IconToggleButton(new ParallelWayAction(this))); 134 136 135 137 toolGroup.setSelected(((AbstractButton)toolBarActions.getComponent(0)).getModel(), true); -
trunk/src/org/openstreetmap/josm/tools/Geometry.java
r4126 r4134 334 334 } 335 335 336 public static EastNorth closestPointToLine(EastNorth lineP1, EastNorth lineP2, EastNorth point) { 337 double ldx = lineP2.getX() - lineP1.getX(); 338 double ldy = lineP2.getY() - lineP1.getY(); 339 340 if (ldx == 0 && ldy == 0) //segment zero length 341 return lineP1; 342 343 double pdx = point.getX() - lineP1.getX(); 344 double pdy = point.getY() - lineP1.getY(); 345 346 double offset = (pdx * ldx + pdy * ldy) / (ldx * ldx + ldy * ldy); 347 return new EastNorth(lineP1.getX() + ldx * offset, lineP1.getY() + ldy * offset); 348 } 349 336 350 /** 337 351 * This method tests if secondNode is clockwise to first node.
Note:
See TracChangeset
for help on using the changeset viewer.