Changeset 9914 in josm
- Timestamp:
- 2016-03-02T21:29:52+01:00 (9 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java
r9893 r9914 206 206 scaleList = scaleList.withIntermediateSteps(PROP_ZOOM_RATIO.get()); 207 207 } 208 Scale s cale= scaleList.scaleZoomTimes(getScale(), PROP_ZOOM_RATIO.get(), times);209 return s cale.getScale();208 Scale s = scaleList.scaleZoomTimes(getScale(), PROP_ZOOM_RATIO.get(), times); 209 return s != null ? s.getScale() : 0; 210 210 } else { 211 211 return getScale() * Math.pow(PROP_ZOOM_RATIO.get(), times); -
trunk/src/org/openstreetmap/josm/gui/layer/NativeScaleLayer.java
r9883 r9914 222 222 public Scale scaleZoomIn(double scale, double ratio) { 223 223 Scale snap = getSnapScale(scale, ratio, false); 224 Scale next = getNextIn(snap, ratio); 225 return next; 224 return getNextIn(snap, ratio); 226 225 } 227 226 … … 234 233 public Scale scaleZoomOut(double scale, double ratio) { 235 234 Scale snap = getSnapScale(scale, ratio, false); 236 Scale next = getNextOut(snap, ratio); 237 return next; 235 return getNextOut(snap, ratio); 238 236 } 239 237 … … 248 246 249 247 private Scale getNextIn(Scale scale, double ratio) { 248 if (scale == null) 249 return null; 250 250 int nextIndex = scale.getIndex() + 1; 251 251 if (nextIndex <= 0 || nextIndex > this.scales.size()-1) { … … 258 258 259 259 private Scale getNextOut(Scale scale, double ratio) { 260 if (scale == null) 261 return null; 260 262 int nextIndex = scale.getIndex() - 1; 261 263 if (nextIndex < 0 || nextIndex >= this.scales.size()-1) { -
trunk/src/org/openstreetmap/josm/gui/layer/WMTSLayer.java
r9860 r9914 60 60 @Override 61 61 protected int getBestZoom() { 62 if (!Main.isDisplayingMapView()) return 0; 62 if (!Main.isDisplayingMapView()) 63 return 0; 64 Scale snap = getNativeScales().getSnapScale(Main.map.mapView.getScale(), false); 63 65 return Math.max( 64 66 getMinZoomLvl(), 65 67 Math.min( 66 getNativeScales().getSnapScale(Main.map.mapView.getScale(), false).getIndex(),68 snap != null ? snap.getIndex() : getMaxZoomLvl(), 67 69 getMaxZoomLvl() 68 70 )
Note:
See TracChangeset
for help on using the changeset viewer.