Changeset 15918 in josm for trunk/src/org/openstreetmap


Ignore:
Timestamp:
2020-02-24T01:01:14+01:00 (5 years ago)
Author:
Don-vip
Message:

fix #18720 - see #11856 - Automatically enable "Tile zoom offset" in HIDPI mode

Location:
trunk/src/org/openstreetmap/josm
Files:
2 edited

Legend:

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

    r15716 r15918  
    128128import org.openstreetmap.josm.tools.MemoryManager.MemoryHandle;
    129129import org.openstreetmap.josm.tools.MemoryManager.NotEnoughMemoryException;
     130import org.openstreetmap.josm.tools.PlatformManager;
    130131import org.openstreetmap.josm.tools.Utils;
    131132import org.openstreetmap.josm.tools.bugreport.BugReport;
     
    172173     * lower resolution of imagery useful in "retina" displays, positive values will result in higher resolution
    173174     */
    174     public static final IntegerProperty ZOOM_OFFSET = new IntegerProperty(PREFERENCE_PREFIX + ".zoom_offset", 0);
     175    public static final IntegerProperty ZOOM_OFFSET = new IntegerProperty(PREFERENCE_PREFIX + ".zoom_offset",
     176            PlatformManager.getPlatform().isHighDpiDisplay() ? 2 : 0);
    175177
    176178    /*
  • trunk/src/org/openstreetmap/josm/tools/PlatformHook.java

    r15469 r15918  
    138138
    139139    /**
     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.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDefaultConfiguration()
     147                .getDefaultTransform().isIdentity();
     148    }
     149
     150    /**
    140151     * Renames a file.
    141152     * @param from Source file
Note: See TracChangeset for help on using the changeset viewer.