Changeset 10115 in josm for trunk/src/org/openstreetmap/josm/actions/mapmode
- Timestamp:
- 2016-04-07T00:02:22+02:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/mapmode/ExtrudeAction.java
r10001 r10115 763 763 } 764 764 return bestMovement; 765 766 767 765 } 768 766 … … 1026 1024 Point p4 = mv.getPoint(newN2en); 1027 1025 1028 Point2D normalUnitVector = getNormalUniVector(); 1026 Point2D normalUnitVector = activeMoveDirection != null ? getNormalUniVector() : null; 1029 1027 1030 1028 if (mode == Mode.extrude || mode == Mode.create_new) { … … 1033 1031 // Draw rectangle around new area. 1034 1032 GeneralPath b = new GeneralPath(); 1035 b.moveTo(p1.x, p1.y); b.lineTo(p3.x, p3.y); 1036 b.lineTo(p4.x, p4.y); b.lineTo(p2.x, p2.y); 1033 b.moveTo(p1.x, p1.y); 1034 b.lineTo(p3.x, p3.y); 1035 b.lineTo(p4.x, p4.y); 1036 b.lineTo(p2.x, p2.y); 1037 1037 b.lineTo(p1.x, p1.y); 1038 1038 g2.draw(b); … … 1042 1042 drawReferenceSegment(g2, mv, dualAlignSegment1); 1043 1043 drawReferenceSegment(g2, mv, dualAlignSegment2); 1044 } else if (activeMoveDirection != null) { 1044 } else if (activeMoveDirection != null && normalUnitVector != null) { 1045 1045 // Draw reference way 1046 1046 drawReferenceSegment(g2, mv, activeMoveDirection); … … 1052 1052 double headingMoveDir = Math.atan2(normalUnitVector.getY(), normalUnitVector.getX()); 1053 1053 double headingDiff = headingRefWS - headingMoveDir; 1054 if (headingDiff < 0) headingDiff += 2 * Math.PI; 1054 if (headingDiff < 0) 1055 headingDiff += 2 * Math.PI; 1055 1056 boolean mirrorRA = Math.abs(headingDiff - Math.PI) > 1e-5; 1056 1057 Point pr1 = mv.getPoint(activeMoveDirection.p1);
Note:
See TracChangeset
for help on using the changeset viewer.
