Changeset 35818 in osm for applications/editors
- Timestamp:
- 2021-09-24T08:14:42+02:00 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/buildings_tools/src/org/openstreetmap/josm/plugins/buildings_tools/DrawBuildingAction.java
r35756 r35818 64 64 private Point drawStartPos; 65 65 private Point mousePos; 66 /** Force a reasonable dimension */ 67 private static final double MIN_LEN_WIDTH = 1E-6; 66 68 67 69 final transient Building building = new Building(); … … 244 246 if (isRectDrawing()) { 245 247 building.setPlaceRect(p); 248 if (building.getLength() < MIN_LEN_WIDTH) 249 return Mode.Drawing; 246 250 return shift ? Mode.DrawingAngFix : Mode.None; 247 251 } else if (ToolSettings.Shape.CIRCLE == ToolSettings.getShape()) { … … 251 255 building.setPlace(p, ToolSettings.getWidth(), ToolSettings.getLenStep(), shift); 252 256 } 257 if (building.getLength() < MIN_LEN_WIDTH) 258 return Mode.Drawing; 253 259 MainApplication.getMap().statusLine.setDist(building.getLength()); 254 this.nextMode = Mode.None; 255 return this.nextMode; 260 return Mode.None; 256 261 } else { 257 262 building.setPlace(p, ToolSettings.getWidth(), ToolSettings.getLenStep(), shift); 263 if (building.getLength() < MIN_LEN_WIDTH) 264 return Mode.Drawing; 258 265 MainApplication.getMap().statusLine.setDist(building.getLength()); 259 this.nextMode = ToolSettings.getWidth() == 0 ? Mode.DrawingWidth : Mode.None; 260 return this.nextMode; 266 return ToolSettings.getWidth() == 0 ? Mode.DrawingWidth : Mode.None; 261 267 } 262 268 } … … 264 270 private Mode modeDrawingWidth() { 265 271 building.setWidth(getEastNorth()); 266 MainApplication.getMap().statusLine.setDist(Math.abs(building.getWidth())); 267 return Mode.None; 272 double width = Math.abs(building.getWidth()); 273 MainApplication.getMap().statusLine.setDist(width); 274 return width < MIN_LEN_WIDTH ? Mode.DrawingWidth : Mode.None; 268 275 } 269 276
Note:
See TracChangeset
for help on using the changeset viewer.