Changeset 9419 in josm for trunk/src/org/openstreetmap/josm/gui
- Timestamp:
- 2016-01-12T17:39:45+01:00 (10 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui
- Files:
-
- 2 edited
-
NavigatableComponent.java (modified) (2 diffs)
-
util/HighlightHelper.java (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java
r9408 r9419 311 311 } 312 312 313 public ProjectionBounds getProjectionBounds(Rectangle r) { 314 EastNorth p1 = getEastNorth(r.x, r.y); 315 EastNorth p2 = getEastNorth(r.x + r.width, r.y + r.height); 316 ProjectionBounds pb = new ProjectionBounds(p1); 317 pb.extend(p2); 318 return pb; 319 } 320 313 321 /** 314 322 * @param r rectangle … … 316 324 */ 317 325 public Bounds getLatLonBounds(Rectangle r) { 318 // TODO Maybe this should be (optional) method of Projection implementation 319 EastNorth p1 = getEastNorth(r.x, r.y); 320 EastNorth p2 = getEastNorth(r.x + r.width, r.y + r.height); 321 322 Bounds result = new Bounds(Main.getProjection().eastNorth2latlon(p1)); 323 324 double eastMin = Math.min(p1.east(), p2.east()); 325 double eastMax = Math.max(p1.east(), p2.east()); 326 double northMin = Math.min(p1.north(), p2.north()); 327 double northMax = Math.max(p1.north(), p2.north()); 328 double deltaEast = (eastMax - eastMin) / 10; 329 double deltaNorth = (northMax - northMin) / 10; 330 331 for (int i = 0; i < 10; i++) { 332 result.extend(Main.getProjection().eastNorth2latlon(new EastNorth(eastMin + i * deltaEast, northMin))); 333 result.extend(Main.getProjection().eastNorth2latlon(new EastNorth(eastMin + i * deltaEast, northMax))); 334 result.extend(Main.getProjection().eastNorth2latlon(new EastNorth(eastMin, northMin + i * deltaNorth))); 335 result.extend(Main.getProjection().eastNorth2latlon(new EastNorth(eastMax, northMin + i * deltaNorth))); 336 } 337 338 return result; 326 return Main.getProjection().getLatLonBoundsBox(getProjectionBounds(r)); 339 327 } 340 328 -
trunk/src/org/openstreetmap/josm/gui/util/HighlightHelper.java
r8929 r9419 14 14 15 15 /** 16 * This class stores the set of highlited primitives and 17 * allows easy and fast change of highlighting 16 * This class stores the set of highlighted primitives and 17 * allows easy and fast change of highlighting. 18 18 */ 19 19 public class HighlightHelper {
Note:
See TracChangeset
for help on using the changeset viewer.
