- Timestamp:
- 2012-03-18T13:02:49+01:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/mapmode/DeleteAction.java
r5076 r5101 192 192 if(!drawTargetHighlight) 193 193 return; 194 removeHighlighting(); 194 195 Set<OsmPrimitive> newHighlights = new HashSet<OsmPrimitive>(); 195 196 196 197 DeleteParameters parameters = getDeleteParameters(e, modifiers); … … 208 209 Command delCmd = buildDeleteCommands(e, modifiers, true); 209 210 if(delCmd == null) { 210 Main.map.mapView.repaint();211 repaintIfRequired(newHighlights); 211 212 return; 212 213 } … … 215 216 // safely do the following 216 217 for(OsmPrimitive osm : delCmd.getParticipatingPrimitives()) { 217 osm.setHighlighted(true); 218 oldHighlights.add(osm); 219 } 220 } 221 Main.map.mapView.repaint(); 218 newHighlights.add(osm); 219 } 220 } 221 repaintIfRequired(newHighlights); 222 } 223 224 private void repaintIfRequired(Set<OsmPrimitive> newHighlights) { 225 boolean needsRepaint = false; 226 for(OsmPrimitive x : newHighlights) { 227 if(oldHighlights.contains(x)) { 228 continue; 229 } 230 needsRepaint = true; 231 x.setHighlighted(true); 232 } 233 oldHighlights.removeAll(newHighlights); 234 for(OsmPrimitive x : oldHighlights) { 235 x.setHighlighted(false); 236 needsRepaint = true; 237 } 238 oldHighlights = newHighlights; 239 if(needsRepaint) { 240 Main.map.mapView.repaint(); 241 } 222 242 } 223 243 … … 284 304 getCurrentDataSet().setSelected(); 285 305 giveUserFeedback(e); 286 Main.map.mapView.repaint();287 306 } 288 307 … … 318 337 Main.main.undoRedo.add(cmd); 319 338 if (getCurrentDataSet().getSelectedRelations().contains(toDelete)) { 320 339 getCurrentDataSet().toggleSelected(toDelete); 321 340 } 322 341 RelationDialogManager.getRelationDialogManager().close(layer, toDelete);
Note:
See TracChangeset
for help on using the changeset viewer.