Changeset 1724 in josm for trunk/src/org/openstreetmap/josm/data/ProjectionBounds.java
- Timestamp:
- 2009-07-03T22:19:22+02:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/ProjectionBounds.java
r1722 r1724 25 25 this.max = max; 26 26 } 27 public ProjectionBounds(EastNorth p) { 28 this.min = p; 29 this.max = p; 30 } 27 31 public ProjectionBounds(EastNorth center, double east, double north) { 28 32 this.min = new EastNorth(center.east()-east/2.0, center.north()-north/2.0); … … 32 36 { 33 37 if (e.east() < min.east() || e.north() < min.north()) 34 min = e;35 elseif (e.east() > max.east() || e.north() > max.north())36 max = e;38 min = new EastNorth(Math.min(e.east(), min.east()), Math.min(e.north(), min.north())); 39 if (e.east() > max.east() || e.north() > max.north()) 40 max = new EastNorth(Math.max(e.east(), max.east()), Math.max(e.north(), max.north())); 37 41 } 38 42 public EastNorth getCenter() 39 43 { 40 return new EastNorth(min.east()/2+max.east()/2, min.north()/2+max.north()/2); 44 return min.getCenter(max); 45 } 46 47 @Override public String toString() { 48 return "ProjectionBounds["+min.east()+","+min.north()+","+max.east()+","+max.north()+"]"; 41 49 } 42 50 }
Note:
See TracChangeset
for help on using the changeset viewer.