Changeset 35908 in osm for applications
- Timestamp:
- 2022-02-07T15:39:46+01:00 (3 years ago)
- Location:
- applications/editors/josm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/buildings_tools/src/org/openstreetmap/josm/plugins/buildings_tools/Building.java
r35668 r35908 210 210 211 211 public void paint(Graphics2D g, MapView mv) { 212 if (len == 0) 212 // Make a local copy to avoid other threads resetting what we are drawing. 213 // See JOSM #21833 for at least one instance where _something_ happens to cause 214 // an NPE here. 215 final EastNorth[] temporaryEnArray = Arrays.copyOf(en, en.length); 216 if (len == 0 || temporaryEnArray[0] == null || temporaryEnArray[1] == null) { 213 217 return; 218 } 214 219 GeneralPath b = new GeneralPath(); 215 Point pp1 = mv.getPoint(eastNorth2latlon( en[0]));216 Point pp2 = mv.getPoint(eastNorth2latlon( en[1]));220 Point pp1 = mv.getPoint(eastNorth2latlon(temporaryEnArray[0])); 221 Point pp2 = mv.getPoint(eastNorth2latlon(temporaryEnArray[1])); 217 222 b.moveTo(pp1.x, pp1.y); 218 223 b.lineTo(pp2.x, pp2.y); 219 if (ToolSettings.Shape.RECTANGLE == ToolSettings.getShape()) { 220 Point pp3 = mv.getPoint(eastNorth2latlon(en[2])); 221 Point pp4 = mv.getPoint(eastNorth2latlon(en[3])); 224 if (ToolSettings.Shape.RECTANGLE == ToolSettings.getShape() 225 && temporaryEnArray[2] != null && temporaryEnArray[3] != null) { 226 Point pp3 = mv.getPoint(eastNorth2latlon(temporaryEnArray[2])); 227 Point pp4 = mv.getPoint(eastNorth2latlon(temporaryEnArray[3])); 222 228 b.lineTo(pp3.x, pp3.y); 223 229 b.lineTo(pp4.x, pp4.y);
Note:
See TracChangeset
for help on using the changeset viewer.