- Timestamp:
- 2008-11-18T16:52:54+01:00 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java
r1082 r1083 175 175 */ 176 176 @Override public void paint(final Graphics g, final MapView mv) { 177 boolean inactive = Main.map.mapView.getActiveLayer() != this && Main.pref.getBoolean("draw.data.inactive_color", true); 177 boolean active = Main.map.mapView.getActiveLayer() == this; 178 boolean inactive = !active && Main.pref.getBoolean("draw.data.inactive_color", true); 178 179 boolean virtual = !inactive && Main.map.mapView.useVirtualNodes(); 179 if (Main.pref.getBoolean("draw.data.downloaded_area", true)) { 180 181 // draw the hatched area for non-downloaded region. only draw if we're the active 182 // and bounds are defined; don't draw for inactive layers or loaded GPX files etc 183 if (active && Main.pref.getBoolean("draw.data.downloaded_area", true) && !data.dataSources.isEmpty()) { 180 184 // initialize area with current viewport 181 Area b = new Area(Main.map.mapView.getBounds()); 182 185 Rectangle b = Main.map.mapView.getBounds(); 186 // on some platforms viewport bounds seem to be offset from the left, 187 // over-grow it just to be sure 188 b.grow(100, 100); 189 Area a = new Area(b); 190 183 191 // now succesively subtract downloaded areas 184 192 for (DataSource src : data.dataSources) { … … 189 197 Point p2 = mv.getPoint(en2); 190 198 Rectangle r = new Rectangle(Math.min(p1.x, p2.x),Math.min(p1.y, p2.y),Math.abs(p2.x-p1.x),Math.abs(p2.y-p1.y)); 191 b.subtract(new Area(r));199 a.subtract(new Area(r)); 192 200 } 193 201 } … … 195 203 // paint remainder 196 204 ((Graphics2D)g).setPaint(hatched); 197 ((Graphics2D)g).fill( b);205 ((Graphics2D)g).fill(a); 198 206 } 199 207
Note:
See TracChangeset
for help on using the changeset viewer.