Changeset 35833 in osm for applications/editors/josm


Ignore:
Timestamp:
2021-10-27T09:11:31+02:00 (3 years ago)
Author:
GerdP
Message:

see #21154
Don't deny split with message "The selected nodes can not be consecutive nodes in the object." when a splitway is used that has more than two nodes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/actions/SplitObjectAction.java

    r35792 r35833  
    222222        }
    223223        // both nodes aren't allowed to be consecutive
    224         if (nodeIndex1 == nodeIndex2 + 1 ||
    225                 nodeIndex2 == nodeIndex1 + 1 ||
    226                 // minus 2 because we've a circular way where
    227                 // the penultimate node is the last unique one
    228                 (nodeIndex1 == 0 && nodeIndex2 == selectedWay.getNodesCount() - 2) ||
    229                 (nodeIndex2 == 0 && nodeIndex1 == selectedWay.getNodesCount() - 2)) {
     224                if ((splitWay == null || splitWay.getNodesCount() == 2)
     225                                && (nodeIndex1 == nodeIndex2 + 1 || nodeIndex2 == nodeIndex1 + 1 ||
     226                                // minus 2 because we've a circular way where
     227                                // the penultimate node is the last unique one
     228                                                (nodeIndex1 == 0 && nodeIndex2 == selectedWay.getNodesCount() - 2)
     229                                                || (nodeIndex2 == 0 && nodeIndex1 == selectedWay.getNodesCount() - 2))) {
    230230            showWarningNotification(
    231231                    tr("The selected nodes can not be consecutive nodes in the object."));
Note: See TracChangeset for help on using the changeset viewer.