Ticket #10286: ExtrudeAction.java.patch

File ExtrudeAction.java.patch, 2.5 KB (added by Hojoe, 5 years ago)
  • src/org/openstreetmap/josm/actions/mapmode/ExtrudeAction.java

     
    4848import org.openstreetmap.josm.gui.layer.Layer;
    4949import org.openstreetmap.josm.gui.layer.MapViewPaintable;
    5050import org.openstreetmap.josm.gui.layer.OsmDataLayer;
    51 import org.openstreetmap.josm.gui.util.KeyPressReleaseListener;
    5251import org.openstreetmap.josm.gui.util.GuiHelper;
     52import org.openstreetmap.josm.gui.util.KeyPressReleaseListener;
    5353import org.openstreetmap.josm.gui.util.ModifierListener;
    5454import org.openstreetmap.josm.tools.Geometry;
    5555import org.openstreetmap.josm.tools.ImageProvider;
     
    622622        Node prevNode = getPreviousNode(selectedSegment.lowerIndex);
    623623        boolean nodeOverlapsSegment = prevNode != null && Geometry.segmentsParallel(initialN1en, prevNode.getEastNorth(), initialN1en, newN1en);
    624624        // segmentAngleZero marks subset of nodeOverlapsSegment. nodeOverlapsSegment is true if angle between segments is 0 or PI, segmentAngleZero only if angle is 0
    625         boolean segmentAngleZero = prevNode != null && Math.abs(Geometry.getCornerAngle(prevNode.getEastNorth(), initialN1en, newN1en)) < 1e-5;
     625        boolean segmentAngleZero = prevNode != null && Math.abs(Geometry.getCornerAngle(prevNode.getEastNorth(), initialN1en, newN1en)) < 1e-2;
    626626        boolean hasOtherWays = hasNodeOtherWays(selectedSegment.getFirstNode(), selectedSegment.way);
    627627        ArrayList<Node> changedNodes = new ArrayList<>();
    628628        if (nodeOverlapsSegment && !alwaysCreateNodes && !hasOtherWays) {
     
    652652        //find if the new points overlap existing segments (in case of 90 degree angles)
    653653        Node nextNode = getNextNode(selectedSegment.lowerIndex + 1);
    654654        nodeOverlapsSegment = nextNode != null && Geometry.segmentsParallel(initialN2en, nextNode.getEastNorth(), initialN2en, newN2en);
    655         segmentAngleZero = nextNode != null && Math.abs(Geometry.getCornerAngle(nextNode.getEastNorth(), initialN2en, newN2en)) < 1e-5;
     655        segmentAngleZero = nextNode != null && Math.abs(Geometry.getCornerAngle(nextNode.getEastNorth(), initialN2en, newN2en)) < 1e-2;
    656656        hasOtherWays = hasNodeOtherWays(selectedSegment.getSecondNode(), selectedSegment.way);
    657657
    658658        if (nodeOverlapsSegment && !alwaysCreateNodes && !hasOtherWays) {