Ignore:
Timestamp:
2012-05-12T18:23:08+02:00 (12 years ago)
Author:
bastiK
Message:

separate preference gui from core projection code (there may be bugs)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/Main.java

    r5226 r5234  
    816816        CheckParameterUtil.ensureParameterNotNull(p);
    817817        Projection oldValue = proj;
     818        Bounds b = (Main.map != null && Main.map.mapView != null) ? Main.map.mapView.getRealBounds() : null;
    818819        proj = p;
    819         fireProjectionChanged(oldValue, proj);
     820        fireProjectionChanged(oldValue, proj, b);
    820821    }
    821822
     
    827828    private static final ArrayList<WeakReference<ProjectionChangeListener>> listeners = new ArrayList<WeakReference<ProjectionChangeListener>>();
    828829
    829     private static void fireProjectionChanged(Projection oldValue, Projection newValue) {
     830    private static void fireProjectionChanged(Projection oldValue, Projection newValue, Bounds oldBounds) {
    830831        if (newValue == null ^ oldValue == null
    831832                || (newValue != null && oldValue != null && !Utils.equal(newValue.toCode(), oldValue.toCode()))) {
     
    843844                }
    844845            }
    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);
    850848            }
    851849            /* TODO - remove layers with fixed projection */
Note: See TracChangeset for help on using the changeset viewer.