Changeset 14993 in josm


Ignore:
Timestamp:
2019-04-15T07:30:58+02:00 (4 years ago)
Author:
GerdP
Message:

fix #17591: Add new preference zoom.scale-follow-native-resolution-at-load

Location:
trunk/src/org/openstreetmap/josm/gui
Files:
3 edited

Legend:

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

    r14985 r14993  
    108108    /** Divide intervals between native resolution levels to smaller steps if they are much larger than zoom ratio */
    109109    public static final BooleanProperty PROP_ZOOM_INTERMEDIATE_STEPS = new BooleanProperty("zoom.intermediate-steps", true);
     110    /** scale follows native resolution of layer status when layer is created */
     111    public static final BooleanProperty PROP_ZOOM_SCALE_FOLLOWS_NATIVE_RESOLUTION_AT_LOAD = new BooleanProperty(
     112            "zoom.scale-follow-native-resolution-at-load", true);
    110113
    111114    /**
  • trunk/src/org/openstreetmap/josm/gui/dialogs/LayerListDialog.java

    r14607 r14993  
    539539                boolean active = ((NativeScaleLayer) layer) == MainApplication.getMap().mapView.getNativeScaleLayer();
    540540                cb.setSelected(active);
    541                 cb.setToolTipText(active
    542                     ? tr("scale follows native resolution of this layer")
    543                     : tr("scale follows native resolution of another layer (click to set this layer)")
    544                 );
     541                if (MainApplication.getMap().mapView.getNativeScaleLayer() != null) {
     542                    cb.setToolTipText(active
     543                            ? tr("scale follows native resolution of this layer")
     544                            : tr("scale follows native resolution of another layer (click to set this layer)"));
     545                } else {
     546                    cb.setToolTipText(tr("scale does not follow native resolution of any layer (click to set this layer)"));
     547                }
    545548            } else {
    546549                cb.setSelected(false);
  • trunk/src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java

    r14902 r14993  
    9696import org.openstreetmap.josm.gui.MainApplication;
    9797import org.openstreetmap.josm.gui.MapView;
     98import org.openstreetmap.josm.gui.NavigatableComponent;
    9899import org.openstreetmap.josm.gui.NavigatableComponent.ZoomChangeListener;
    99100import org.openstreetmap.josm.gui.Notification;
     
    555556        MapView.addZoomChangeListener(this);
    556557
    557         if (this instanceof NativeScaleLayer) {
     558        if (this instanceof NativeScaleLayer && NavigatableComponent.PROP_ZOOM_SCALE_FOLLOWS_NATIVE_RESOLUTION_AT_LOAD.get()) {
    558559            event.getMapView().setNativeScaleLayer((NativeScaleLayer) this);
    559560        }
Note: See TracChangeset for help on using the changeset viewer.