Ticket #8796: 8796.patch

File 8796.patch, 966 bytes (added by AlfonZ, 11 years ago)
  • src/org/openstreetmap/josm/actions/mapmode/ExtrudeAction.java

     
    433433        Collection<Command> cmds = new LinkedList<Command>();
    434434        Way wnew = new Way(selectedSegment.way);
    435435        boolean wayWasModified = false;
     436        boolean wayWasSingleSegment = wnew.getNodesCount() == 2;
    436437        int insertionPoint = selectedSegment.lowerIndex + 1;
    437438
    438439        //find if the new points overlap existing segments (in case of 90 degree angles)
     
    472473        }
    473474
    474475        //the way was a single segment, close the way
    475         if (wnew.getNodesCount() == 4) {
     476        if (wayWasSingleSegment) {
    476477            wnew.addNode(selectedSegment.getFirstNode());
    477478            wayWasModified = true;
    478479        }