Changeset 13400 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2018-02-10T01:40:02+01:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/MapView.java
r13173 r13400 490 490 491 491 try { 492 drawMapContent( g);492 drawMapContent((Graphics2D) g); 493 493 } catch (JosmRuntimeException | IllegalArgumentException | IllegalStateException e) { 494 494 throw BugReport.intercept(e).put("visibleLayers", layerManager::getVisibleLayersInZOrder) … … 498 498 } 499 499 500 private void drawMapContent(Graphics g) {500 private void drawMapContent(Graphics2D g) { 501 501 // In HiDPI-mode, the Graphics g will have a transform that scales 502 502 // everything by a factor of 2.0 or so. At the same time, the value returned … … 509 509 // (Otherwise, we would upscale a small buffer image and the result would be 510 510 // blurry, with 2x2 pixel blocks.) 511 Graphics2D gg = (Graphics2D) g; 512 AffineTransform trOrig = gg.getTransform(); 513 double uiScaleX = gg.getTransform().getScaleX(); 514 double uiScaleY = gg.getTransform().getScaleY(); 511 AffineTransform trOrig = g.getTransform(); 512 double uiScaleX = g.getTransform().getScaleX(); 513 double uiScaleY = g.getTransform().getScaleY(); 515 514 // width/height in full-resolution screen pixels 516 515 int width = (int) Math.round(getWidth() * uiScaleX); … … 615 614 616 615 try { 617 g g.setTransform(new AffineTransform(1, 0, 0, 1, trOrig.getTranslateX(), trOrig.getTranslateY()));618 g g.drawImage(offscreenBuffer, 0, 0, null);616 g.setTransform(new AffineTransform(1, 0, 0, 1, trOrig.getTranslateX(), trOrig.getTranslateY())); 617 g.drawImage(offscreenBuffer, 0, 0, null); 619 618 } catch (ClassCastException e) { 620 619 // See #11002 and duplicate tickets. On Linux with Java >= 8 Many users face this error here: … … 643 642 Logging.error(e); 644 643 } finally { 645 g g.setTransform(trOrig);644 g.setTransform(trOrig); 646 645 } 647 646 }
Note:
See TracChangeset
for help on using the changeset viewer.