Changeset 9358 in josm
- Timestamp:
- 2016-01-09T19:47:49+01:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/mapmode/ImproveWayAccuracyAction.java
r8915 r9358 82 82 private transient Stroke selectTargetWayStroke; 83 83 private transient Stroke moveNodeStroke; 84 private transient Stroke moveNodeIntersectingStroke; 84 85 private transient Stroke addNodeStroke; 85 86 private transient Stroke deleteNodeStroke; … … 147 148 selectTargetWayStroke = GuiHelper.getCustomizedStroke(Main.pref.get("improvewayaccuracy.stroke.select-target", "2")); 148 149 moveNodeStroke = GuiHelper.getCustomizedStroke(Main.pref.get("improvewayaccuracy.stroke.move-node", "1 6")); 150 moveNodeIntersectingStroke = GuiHelper.getCustomizedStroke(Main.pref.get("improvewayaccuracy.stroke.move-node-intersecting", "1 2 6")); 149 151 addNodeStroke = GuiHelper.getCustomizedStroke(Main.pref.get("improvewayaccuracy.stroke.add-node", "1")); 150 152 deleteNodeStroke = GuiHelper.getCustomizedStroke(Main.pref.get("improvewayaccuracy.stroke.delete-node", "1")); … … 308 310 } 309 311 312 if (!alt && !ctrl && candidateNode != null) { 313 b.reset(); 314 drawIntersectingWayHelperLines(mv, b); 315 g.setStroke(moveNodeIntersectingStroke); 316 g.draw(b); 317 } 318 319 } 320 } 321 322 protected void drawIntersectingWayHelperLines(MapView mv, GeneralPath b) { 323 for (final OsmPrimitive referrer : candidateNode.getReferrers()) { 324 if (!(referrer instanceof Way) || targetWay.equals(referrer)) { 325 continue; 326 } 327 final List<Node> nodes = ((Way) referrer).getNodes(); 328 for (int i = 0; i < nodes.size(); i++) { 329 if (!candidateNode.equals(nodes.get(i))) { 330 continue; 331 } 332 if (i > 0) { 333 final Point p = mv.getPoint(nodes.get(i - 1)); 334 b.moveTo(mousePos.x, mousePos.y); 335 b.lineTo(p.x, p.y); 336 } 337 if (i < nodes.size() - 1) { 338 final Point p = mv.getPoint(nodes.get(i + 1)); 339 b.moveTo(mousePos.x, mousePos.y); 340 b.lineTo(p.x, p.y); 341 } 342 } 310 343 } 311 344 }
Note:
See TracChangeset
for help on using the changeset viewer.