- Timestamp:
- 2020-06-14T12:17:27+02:00 (4 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java
r16615 r16619 128 128 import org.openstreetmap.josm.tools.MemoryManager.MemoryHandle; 129 129 import org.openstreetmap.josm.tools.MemoryManager.NotEnoughMemoryException; 130 import org.openstreetmap.josm.tools.PlatformManager;131 130 import org.openstreetmap.josm.tools.Utils; 132 131 import org.openstreetmap.josm.tools.bugreport.BugReport; … … 173 172 * lower resolution of imagery useful in "retina" displays, positive values will result in higher resolution 174 173 */ 175 public static final IntegerProperty ZOOM_OFFSET = new IntegerProperty(PREFERENCE_PREFIX + ".zoom_offset", 176 PlatformManager.getPlatform().isHighDpiDisplay() ? 2 : 0); 174 public static final IntegerProperty ZOOM_OFFSET = new IntegerProperty(PREFERENCE_PREFIX + ".zoom_offset", 0); 177 175 178 176 private static final BooleanProperty POPUP_MENU_ENABLED = new BooleanProperty(PREFERENCE_PREFIX + ".popupmenu", true); -
trunk/src/org/openstreetmap/josm/gui/layer/imagery/TileCoordinateConverter.java
r14505 r16619 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; … … 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; -
trunk/src/org/openstreetmap/josm/tools/PlatformHook.java
r15922 r16619 138 138 139 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 display142 * @since 15918143 */144 default boolean isHighDpiDisplay() {145 // https://stackoverflow.com/a/49770313146 return !GraphicsEnvironment.isHeadless() &&147 !GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDefaultConfiguration()148 .getDefaultTransform().isIdentity();149 }150 151 /**152 140 * Renames a file. 153 141 * @param from Source file
Note:
See TracChangeset
for help on using the changeset viewer.