Changeset 5234 in josm for trunk/src/org/openstreetmap/josm/Main.java
- Timestamp:
- 2012-05-12T18:23:08+02:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/Main.java
r5226 r5234 816 816 CheckParameterUtil.ensureParameterNotNull(p); 817 817 Projection oldValue = proj; 818 Bounds b = (Main.map != null && Main.map.mapView != null) ? Main.map.mapView.getRealBounds() : null; 818 819 proj = p; 819 fireProjectionChanged(oldValue, proj );820 fireProjectionChanged(oldValue, proj, b); 820 821 } 821 822 … … 827 828 private static final ArrayList<WeakReference<ProjectionChangeListener>> listeners = new ArrayList<WeakReference<ProjectionChangeListener>>(); 828 829 829 private static void fireProjectionChanged(Projection oldValue, Projection newValue ) {830 private static void fireProjectionChanged(Projection oldValue, Projection newValue, Bounds oldBounds) { 830 831 if (newValue == null ^ oldValue == null 831 832 || (newValue != null && oldValue != null && !Utils.equal(newValue.toCode(), oldValue.toCode()))) { … … 843 844 } 844 845 } 845 if (newValue != null) { 846 Bounds b = (Main.map != null && Main.map.mapView != null) ? Main.map.mapView.getRealBounds() : null; 847 if (b != null){ 848 Main.map.mapView.zoomTo(b); 849 } 846 if (newValue != null && oldBounds != null) { 847 Main.map.mapView.zoomTo(oldBounds); 850 848 } 851 849 /* TODO - remove layers with fixed projection */
Note:
See TracChangeset
for help on using the changeset viewer.