diff --git a/src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java b/src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java
index c807633f6..fed5acbc2 100644
|
a
|
b
|
implements ImageObserver, TileLoaderListener, ZoomChangeListener, FilterChangeLi
|
| 171 | 171 | * Offset between calculated zoom level and zoom level used to download and show tiles. Negative values will result in |
| 172 | 172 | * lower resolution of imagery useful in "retina" displays, positive values will result in higher resolution |
| 173 | 173 | */ |
| 174 | | public static final IntegerProperty ZOOM_OFFSET = new IntegerProperty(PREFERENCE_PREFIX + ".zoom_offset", |
| 175 | | PlatformManager.getPlatform().isHighDpiDisplay() ? 2 : 0); |
| | 174 | public static final IntegerProperty ZOOM_OFFSET = new IntegerProperty(PREFERENCE_PREFIX + ".zoom_offset", 0); |
| 176 | 175 | |
| 177 | 176 | /* |
| 178 | 177 | * use MemoryTileCache instead of tileLoader JCS cache, as tileLoader caches only content (byte[] of image) |
diff --git a/src/org/openstreetmap/josm/gui/layer/imagery/TileCoordinateConverter.java b/src/org/openstreetmap/josm/gui/layer/imagery/TileCoordinateConverter.java
index 0303dd6e6..7e355edc0 100644
|
a
|
b
|
package org.openstreetmap.josm.gui.layer.imagery;
|
| 4 | 4 | import java.awt.Polygon; |
| 5 | 5 | import java.awt.Rectangle; |
| 6 | 6 | import java.awt.Shape; |
| | 7 | import java.awt.geom.AffineTransform; |
| 7 | 8 | import java.awt.geom.Point2D; |
| 8 | 9 | import java.awt.geom.Rectangle2D; |
| 9 | 10 | import java.util.Objects; |
| … |
… |
public class TileCoordinateConverter {
|
| 182 | 183 | t1 = tileSource.projectedToTileXY(CoordinateConversion.enToProj(topLeftEN), zoom); |
| 183 | 184 | t2 = tileSource.projectedToTileXY(CoordinateConversion.enToProj(botRightEN), zoom); |
| 184 | 185 | } |
| 185 | | int screenPixels = mapView.getWidth()*mapView.getHeight(); |
| | 186 | AffineTransform transform = mapView.getGraphicsConfiguration().getDefaultTransform(); |
| | 187 | int screenPixels = (int) (mapView.getWidth()*mapView.getHeight()*transform.getScaleX()*transform.getScaleY()); |
| 186 | 188 | double tilePixels = Math.abs((t2.getY()-t1.getY())*(t2.getX()-t1.getX())*tileSource.getTileSize()*tileSource.getTileSize()); |
| 187 | 189 | if (screenPixels == 0 || tilePixels == 0) return 1; |
| 188 | 190 | return screenPixels/tilePixels; |
diff --git a/src/org/openstreetmap/josm/tools/PlatformHook.java b/src/org/openstreetmap/josm/tools/PlatformHook.java
index abd99e213..19cffad3a 100644
|
a
|
b
|
public interface PlatformHook {
|
| 136 | 136 | GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().isFullScreenSupported(); |
| 137 | 137 | } |
| 138 | 138 | |
| 139 | | /** |
| 140 | | * Determines if the default screen is a high-dpi device such as a mac Retina display. |
| 141 | | * @return {@code true} if the default screen is a high-dpi device such as a mac Retina display |
| 142 | | * @since 15918 |
| 143 | | */ |
| 144 | | default boolean isHighDpiDisplay() { |
| 145 | | // https://stackoverflow.com/a/49770313 |
| 146 | | return !GraphicsEnvironment.isHeadless() && |
| 147 | | !GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDefaultConfiguration() |
| 148 | | .getDefaultTransform().isIdentity(); |
| 149 | | } |
| 150 | | |
| 151 | 139 | /** |
| 152 | 140 | * Renames a file. |
| 153 | 141 | * @param from Source file |