diff options
author | Anton Tarasov <anton.tarasov@jetbrains.com> | 2018-03-02 20:33:21 +0300 |
---|---|---|
committer | Anton Tarasov <anton.tarasov@jetbrains.com> | 2018-03-05 16:38:00 +0300 |
commit | b578d33aac8f33cc0758b73ceb6484c686996b3a (patch) | |
tree | 04190bdf1ebc198ac8a7c9883eab950b7394b95d | |
parent | 742436f5ffb813c2a9a3ac1459f041a2028bc0f3 (diff) | |
download | jdk8u_jdk-b578d33aac8f33cc0758b73ceb6484c686996b3a.tar.gz |
JRE-675 typo in the fix for JRE-604jb8u152-b1153.5
(cherry picked from commit f0c9e69)
-rw-r--r-- | src/share/classes/javax/swing/RepaintManager.java | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/src/share/classes/javax/swing/RepaintManager.java b/src/share/classes/javax/swing/RepaintManager.java index 4af8859c10..3f767e996d 100644 --- a/src/share/classes/javax/swing/RepaintManager.java +++ b/src/share/classes/javax/swing/RepaintManager.java @@ -1579,18 +1579,15 @@ public class RepaintManager Graphics g, int clipX, int clipY, int clipW, int clipH) { - Graphics gg = g; - // [tav] For the scaling graphics we need to compensate the toplevel insets rounding error - // to place [0, 0] of the client area in its correct device pixel. - if (g instanceof SunGraphics2D) { - SunGraphics2D sg = (SunGraphics2D)gg; + SunGraphics2D sg = (SunGraphics2D)g.create(); + try { + // [tav] For the scaling graphics we need to compensate the toplevel insets rounding error + // to place [0, 0] of the client area in its correct device pixel. if (sg.transformState == SunGraphics2D.TRANSFORM_TRANSLATESCALE) { Point2D err = getInsetsRoundingError(sg); double errX = err.getX(); double errY = err.getY(); if (errX != 0 || errY != 0) { - gg = sg = (SunGraphics2D)sg.create(); - // save the current tx AffineTransform tx = sg.transform; @@ -1632,15 +1629,13 @@ public class RepaintManager sg.setTransform(newTx); } } - } - try { if (image instanceof VolatileImage && isPixelsCopying(c, g)) { - paintDoubleBufferedFPScales(c, image, gg, clipX, clipY, clipW, clipH); + paintDoubleBufferedFPScales(c, image, sg, clipX, clipY, clipW, clipH); } else { - paintDoubleBufferedImpl(c, image, gg, clipX, clipY, clipW, clipH); + paintDoubleBufferedImpl(c, image, sg, clipX, clipY, clipW, clipH); } } finally { - if (gg != g) g.dispose(); + sg.dispose(); } } |