- Timestamp:
- 2009-11-10T21:22:18+01:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/mapmode/ExtrudeAction.java
r2429 r2432 12 12 import java.awt.Point; 13 13 import java.awt.Rectangle; 14 import java.awt.event.ActionEvent; 14 15 import java.awt.event.KeyEvent; 15 16 import java.awt.event.MouseEvent; 16 import java.awt.event.ActionEvent;17 17 import java.awt.geom.AffineTransform; 18 import java.awt.geom.GeneralPath; 19 import java.awt.geom.Line2D; 18 20 import java.awt.geom.NoninvertibleTransformException; 19 import java.awt.geom.GeneralPath;20 21 import java.awt.geom.Point2D; 21 import java.awt.geom.Line2D;22 import java.awt.geom.Line2D.Double;23 import java.lang.Math;24 22 import java.util.Collection; 25 23 import java.util.LinkedList; … … 188 186 // Better way of testing list equality non-order-sensitively? 189 187 if (c instanceof MoveCommand 190 && ((MoveCommand)c).getMovedNodes().contains(n1)191 && ((MoveCommand)c).getMovedNodes().contains(n2)192 && ((MoveCommand)c).getMovedNodes().size() == 2) {188 && ((MoveCommand)c).getMovedNodes().contains(n1) 189 && ((MoveCommand)c).getMovedNodes().contains(n2) 190 && ((MoveCommand)c).getMovedNodes().size() == 2) { 193 191 // MoveCommand doesn't let us know how much it has already moved the selection 194 192 // so we have to do some ugly record-keeping. … … 268 266 // Check to see if our new N1 is in a positive direction with respect to the normalUnitVector. 269 267 // Even if the x component is zero, we should still be able to discern using +0.0 and -0.0 270 if (newN1en == null || (newN1en.getX() > initialN1en.getX() == normalUnitVector.getX() > -0.0)) 268 if (newN1en == null || (newN1en.getX() > initialN1en.getX() == normalUnitVector.getX() > -0.0)) { 271 269 drawnorm = normalUnitVector; 272 else270 } else { 273 271 // If not, use a sign-flipped version of the normalUnitVector. 274 272 drawnorm = new EastNorth(-normalUnitVector.getX(), -normalUnitVector.getY()); 273 } 275 274 normline = createSemiInfiniteLine(centerpoint, drawnorm, g2); 276 275 g2.draw(normline); … … 286 285 Point2D ra2 = new Point2D.Double(ra1.getX()-raoffsety, ra1.getY()+raoffsetx); 287 286 GeneralPath ra = new GeneralPath(); 288 ra.moveTo( ra1.getX(),ra1.getY());289 ra.lineTo( ra2.getX(),ra2.getY());290 ra.lineTo( ra3.getX(),ra3.getY());287 ra.moveTo((float)ra1.getX(), (float)ra1.getY()); 288 ra.lineTo((float)ra2.getX(), (float)ra2.getY()); 289 ra.lineTo((float)ra3.getX(), (float)ra3.getY()); 291 290 g2.draw(ra); 292 291 } … … 353 352 // based on that. 354 353 normalTransform = new AffineTransform( 355 r*normalUnitVector.getX()*normalUnitVector.getX(), compcoordcoeff,356 compcoordcoeff, r*normalUnitVector.getY()*normalUnitVector.getY(),357 initialN1en.getX()-(s*r*normalUnitVector.getX()), initialN1en.getY()+(s*r*normalUnitVector.getY()));354 r*normalUnitVector.getX()*normalUnitVector.getX(), compcoordcoeff, 355 compcoordcoeff, r*normalUnitVector.getY()*normalUnitVector.getY(), 356 initialN1en.getX()-(s*r*normalUnitVector.getX()), initialN1en.getY()+(s*r*normalUnitVector.getY())); 358 357 359 358 // Switch mode.
Note:
See TracChangeset
for help on using the changeset viewer.