Index: trunk/src/org/openstreetmap/josm/gui/MapView.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/MapView.java	(revision 13399)
+++ trunk/src/org/openstreetmap/josm/gui/MapView.java	(revision 13400)
@@ -490,5 +490,5 @@
 
         try {
-            drawMapContent(g);
+            drawMapContent((Graphics2D) g);
         } catch (JosmRuntimeException | IllegalArgumentException | IllegalStateException e) {
             throw BugReport.intercept(e).put("visibleLayers", layerManager::getVisibleLayersInZOrder)
@@ -498,5 +498,5 @@
     }
 
-    private void drawMapContent(Graphics g) {
+    private void drawMapContent(Graphics2D g) {
         // In HiDPI-mode, the Graphics g will have a transform that scales
         // everything by a factor of 2.0 or so. At the same time, the value returned
@@ -509,8 +509,7 @@
         // (Otherwise, we would upscale a small buffer image and the result would be
         // blurry, with 2x2 pixel blocks.)
-        Graphics2D gg = (Graphics2D) g;
-        AffineTransform trOrig = gg.getTransform();
-        double uiScaleX = gg.getTransform().getScaleX();
-        double uiScaleY = gg.getTransform().getScaleY();
+        AffineTransform trOrig = g.getTransform();
+        double uiScaleX = g.getTransform().getScaleX();
+        double uiScaleY = g.getTransform().getScaleY();
         // width/height in full-resolution screen pixels
         int width = (int) Math.round(getWidth() * uiScaleX);
@@ -615,6 +614,6 @@
 
         try {
-            gg.setTransform(new AffineTransform(1, 0, 0, 1, trOrig.getTranslateX(), trOrig.getTranslateY()));
-            gg.drawImage(offscreenBuffer, 0, 0, null);
+            g.setTransform(new AffineTransform(1, 0, 0, 1, trOrig.getTranslateX(), trOrig.getTranslateY()));
+            g.drawImage(offscreenBuffer, 0, 0, null);
         } catch (ClassCastException e) {
             // See #11002 and duplicate tickets. On Linux with Java >= 8 Many users face this error here:
@@ -643,5 +642,5 @@
             Logging.error(e);
         } finally {
-            gg.setTransform(trOrig);
+            g.setTransform(trOrig);
         }
     }
