Ignore:
Timestamp:
2013-06-26T14:06:56+02:00 (7 years ago)
Author:
akks
Message:

see #8591: do not allow creating ways with duplicate nodes in Draw mode, even with Ctrl pressed

File:
1 edited

Legend:

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

    r5979 r6027  
    428428        Node n = null;
    429429
    430         if (!ctrl) {
    431             n = Main.map.mapView.getNearestNode(mousePos, OsmPrimitive.isSelectablePredicate);
     430        n = Main.map.mapView.getNearestNode(mousePos, OsmPrimitive.isSelectablePredicate);
     431        if (ctrl) {
     432            Iterator<Way> it = getCurrentDataSet().getSelectedWays().iterator();
     433            if (it.hasNext()) {
     434                // ctrl-click on node of selected way = reuse node despite of ctrl
     435                if (!it.next().containsNode(n)) n = null;
     436            } else {
     437                n=null; // ctrl-click + no selected way = new node
     438            }
    432439        }
    433440
Note: See TracChangeset for help on using the changeset viewer.