- Timestamp:
- 2013-12-27T00:51:13+01:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java
r6336 r6542 179 179 180 180 // update selection to reflect which way being modified 181 if (currentBaseNode != null && getCurrentDataSet() != null && !getCurrentDataSet().getSelected().isEmpty()) { 181 DataSet currentDataSet = getCurrentDataSet(); 182 if (currentBaseNode != null && currentDataSet != null && !currentDataSet.getSelected().isEmpty()) { 182 183 Way continueFrom = getWayForNode(currentBaseNode); 183 184 if (alt && continueFrom != null && (!currentBaseNode.isSelected() || continueFrom.isSelected())) { 184 getCurrentDataSet().beginUpdate(); // to prevent the selection listener to screw around with the state 185 getCurrentDataSet().addSelected(currentBaseNode); 186 getCurrentDataSet().clearSelection(continueFrom); 187 getCurrentDataSet().endUpdate(); 185 addRemoveSelection(currentDataSet, currentBaseNode, continueFrom); 188 186 needsRepaint = true; 189 187 } else if (!alt && continueFrom != null && !continueFrom.isSelected()) { 190 getCurrentDataSet().addSelected(continueFrom);188 addRemoveSelection(currentDataSet, continueFrom, currentBaseNode); 191 189 needsRepaint = true; 192 190 } … … 197 195 } 198 196 return needsRepaint; 197 } 198 199 private static void addRemoveSelection(DataSet ds, OsmPrimitive toAdd, OsmPrimitive toRemove) { 200 ds.beginUpdate(); // to prevent the selection listener to screw around with the state 201 ds.addSelected(toAdd); 202 ds.clearSelection(toRemove); 203 ds.endUpdate(); 199 204 } 200 205
Note:
See TracChangeset
for help on using the changeset viewer.