Changeset 17782 in josm for trunk/src/org
- Timestamp:
- 2021-04-14T20:44:16+02:00 (4 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/layer/geoimage/ImageDisplay.java
r17740 r17782 39 39 import org.openstreetmap.josm.tools.Destroyable; 40 40 import org.openstreetmap.josm.tools.ExifReader; 41 import org.openstreetmap.josm.tools.HiDPISupport; 41 42 import org.openstreetmap.josm.tools.ImageProcessor; 42 43 import org.openstreetmap.josm.tools.ImageProvider; … … 819 820 if (bi != null) { 820 821 r.x = r.y = 0; 821 822 double hiDPIScale = HiDPISupport.getHiDPIScale(); 823 int width = (int) (target.width * hiDPIScale); 824 int height = (int) (target.height * hiDPIScale); 822 825 // See https://community.oracle.com/docs/DOC-983611 - The Perils of Image.getScaledInstance() 823 826 // Pre-scale image when downscaling by more than two times to avoid aliasing from default algorithm 824 bi = ImageProvider.createScaledImage(bi, target.width, target.height, 825 RenderingHints.VALUE_INTERPOLATION_BILINEAR); 826 r.width = target.width; 827 r.height = target.height; 827 bi = ImageProvider.createScaledImage(bi, width, height, RenderingHints.VALUE_INTERPOLATION_BILINEAR); 828 r.width = width; 829 r.height = height; 828 830 image = bi; 829 831 } -
trunk/src/org/openstreetmap/josm/tools/HiDPISupport.java
r16980 r17782 176 176 * @return the GUI scale for HiDPI mode, a value of 1.0 means standard mode. 177 177 */ 178 static double getHiDPIScale() {178 public static double getHiDPIScale() { 179 179 if (GraphicsEnvironment.isHeadless()) 180 180 return 1.0;
Note:
See TracChangeset
for help on using the changeset viewer.