Ticket #14213: josm_buildings_tools_fix_cursor_v1.patch
File josm_buildings_tools_fix_cursor_v1.patch, 1.7 KB (added by , 4 years ago) |
---|
-
plugins/buildings_tools/src/org/openstreetmap/josm/plugins/buildings_tools/DrawBuildingAction.java
54 54 55 55 private final Cursor cursorJoinNode; 56 56 private final Cursor cursorJoinWay; 57 private Cursor currCursor;58 57 private Cursor customCursor; 59 58 60 59 private Mode mode = Mode.None; … … 80 79 // the actual cursor is drawn in enterMode() 81 80 ImageProvider.getCursor("crosshair", null)); 82 81 83 currCursor = getCursor();84 82 cursorJoinNode = ImageProvider.getCursor("crosshair", "joinnode"); 85 83 cursorJoinWay = ImageProvider.getCursor("crosshair", "joinway"); 86 84 } … … 104 102 * @param c One of the available cursors 105 103 */ 106 104 private void setCursor(final Cursor c) { 107 if (currCursor.equals(c)) 108 return; 109 try { 110 // We invoke this to prevent strange things from happening 111 EventQueue.invokeLater(() -> { 112 MapFrame map = MainApplication.getMap(); 113 // Don't change cursor when mode has changed already 114 if (map == null || !(map.mapMode instanceof DrawBuildingAction)) 115 return; 116 map.mapView.setCursor(c); 117 }); 118 currCursor = c; 119 } catch (Exception e) { 120 Logging.error(e); 121 } 105 MainApplication.getMap().mapView.setNewCursor(c, this); 122 106 } 123 107 124 108 private void showAddrDialog(Way w) {