Changeset 7247 in josm for trunk/src


Ignore:
Timestamp:
2014-06-14T08:31:19+02:00 (10 years ago)
Author:
akks
Message:

see #7991: patch by AlfonZ - minor fix to segment collapsion in extrude mode

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/mapmode/ExtrudeAction.java

    r7232 r7247  
    2222import java.awt.geom.Point2D;
    2323import java.util.ArrayList;
    24 import java.util.Arrays;
    2524import java.util.Collection;
    2625import java.util.LinkedList;
     
    5655import org.openstreetmap.josm.tools.ImageProvider;
    5756import org.openstreetmap.josm.tools.Shortcut;
    58 import org.openstreetmap.josm.tools.Utils;
    5957
    6058/**
     
    180178    private ReferenceSegment dualAlignSegment1, dualAlignSegment2;
    181179    /** {@code true}, if new segment was collapsed */
    182     private boolean dualAlignSegmentCollapsed;
     180    private boolean dualAlignSegmentCollapsed = false;
    183181    // Dual alignment UI stuff
    184182    private final DualAlignChangeAction dualAlignChangeAction;
     
    548546            moveCommand = null;
    549547            mode = Mode.select;
     548            dualAlignSegmentCollapsed = false;
    550549            updateStatusLine();
    551550            Main.map.mapView.repaint();
     
    590589        wnew.addNode(selectedSegment.getSecondNode());
    591590        wnew.addNode(third);
    592         if (newN1en.distance(newN2en)>1e-6) {
    593             wnew.addNode(fourth); // rectangle can degrade to triangle for dual alignment
     591        if (!dualAlignSegmentCollapsed) {
     592            // rectangle can degrade to triangle for dual alignment after collapsing
     593            wnew.addNode(fourth);
    594594        }
    595595        // ... and close the way
     
    597597        // undo support
    598598        cmds.add(new AddCommand(third));
    599         cmds.add(new AddCommand(fourth));
     599        if (!dualAlignSegmentCollapsed) {
     600            cmds.add(new AddCommand(fourth));
     601        }
    600602        cmds.add(new AddCommand(wnew));
    601603        Command c = new SequenceCommand(tr("Extrude Way"), cmds);
Note: See TracChangeset for help on using the changeset viewer.