Changeset 1287 in josm
- Timestamp:
- 2009-01-17T22:49:05+01:00 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java
r1262 r1287 34 34 35 35 import org.openstreetmap.josm.Main; 36 import org.openstreetmap.josm.actions.mapmode.SelectAction; 36 37 import org.openstreetmap.josm.command.AddCommand; 37 38 import org.openstreetmap.josm.command.ChangeCommand; … … 167 168 boolean newNode = false; 168 169 Node n = null; 170 boolean wayIsFinished = false; 169 171 170 172 if (!ctrl) { … … 280 282 // existing way or make a new way of its own? The "alt" modifier means that the 281 283 // user wants a new way. 282 283 284 Way way = alt ? null : (selectedWay != null) ? selectedWay : getWayForNode(n0); 285 286 // Don't allow creation of self-overlapping ways 287 if(way != null) { 288 int nodeCount=0; 289 for (Node p : way.nodes) 290 if(p.equals(n0)) nodeCount++; 291 if(nodeCount > 1) way = null; 292 } 293 284 294 if (way == null) { 285 295 way = new Way(); … … 297 307 } 298 308 309 // Connected to a node that's already in the way 310 if(way != null && way.nodes.contains(n)) { 311 System.out.println("Stop drawing, node is part of current way"); 312 wayIsFinished = true; 313 selection.clear(); 314 //Main.map.selectMapMode(new SelectAction(Main.map)); 315 } 316 317 // Add new node to way 299 318 if (way.nodes.get(way.nodes.size() - 1) == n0) { 300 319 way.nodes.add(n); … … 329 348 330 349 Main.main.undoRedo.add(c); 331 lastUsedNode = n;350 if(!wayIsFinished) lastUsedNode = n; 332 351 computeHelperLine(); 333 352 Main.map.mapView.repaint();
Note:
See TracChangeset
for help on using the changeset viewer.