Changeset 35841 in osm for applications/editors/josm/plugins/utilsplugin2
- Timestamp:
- 2021-11-01T08:59:07+01:00 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/actions/SplitObjectAction.java
r35833 r35841 222 222 } 223 223 // both nodes aren't allowed to be consecutive 224 225 226 227 228 229 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))) { 230 230 showWarningNotification( 231 231 tr("The selected nodes can not be consecutive nodes in the object.")); 232 232 return; 233 233 } 234 234 splitWayChecked(selectedNodes, selectedWay, splitWay); 235 } 236 237 private void splitWayChecked(List<Node> selectedNodes, Way selectedWay, Way splitWay) { 235 238 List<List<Node>> wayChunks = SplitWayCommand.buildSplitChunks(selectedWay, selectedNodes); 236 239 if (wayChunks != null) { … … 416 419 for (int i = 0; i < outerRing.ways.size() && (firstIndex == -1 || lastIndex == -1); i++) { 417 420 Way w = outerRing.ways.get(i); 418 Boolean reversed = outerRing.reversed.get(i);421 boolean reversed = outerRing.reversed.get(i); 419 422 420 423 Node cStartNode = reversed ? w.lastNode() : w.firstNode(); … … 522 525 Set<Way> mpWays = mpRelation.getMembers().stream() 523 526 .filter(RelationMember::isWay) 524 .collect(Collectors.mapping(RelationMember::getWay, Collectors.toSet())); 527 .map(RelationMember::getWay) 528 .collect(Collectors.toSet()); 525 529 526 530 List<SplitWayCommand> splitCmds = new ArrayList<>(); … … 555 559 * @return true if the selection is usable 556 560 */ 557 private boolean checkSelection(Collection<? extends OsmPrimitive> selection) {561 private static boolean checkSelection(Collection<? extends OsmPrimitive> selection) { 558 562 int node = 0; 559 563 int ways = 0;
Note:
See TracChangeset
for help on using the changeset viewer.