From a46848791c82b81ccb1c6659970a2c0cb215d3d5 Mon Sep 17 00:00:00 2001 From: doncarton Date: Sun, 26 Feb 2017 14:36:34 +0300 Subject: [PATCH] Variable name more readeable --- .../java/mage/client/util/TransformedImageCache.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Mage.Client/src/main/java/mage/client/util/TransformedImageCache.java b/Mage.Client/src/main/java/mage/client/util/TransformedImageCache.java index 285512c0725..56916cfbb3f 100644 --- a/Mage.Client/src/main/java/mage/client/util/TransformedImageCache.java +++ b/Mage.Client/src/main/java/mage/client/util/TransformedImageCache.java @@ -68,7 +68,7 @@ public class TransformedImageCache { } } - static final Map> IMAGE_CACHE; + private static final Map> IMAGE_CACHE; static { // TODO: can we use a single map? @@ -85,17 +85,17 @@ public class TransformedImageCache { private static BufferedImage rotateImage(BufferedImage image, double angle) { double sin = Math.abs(Math.sin(angle)), cos = Math.abs(Math.cos(angle)); - int w = image.getWidth(), h = image.getHeight(); - int neww = (int) Math.floor(w * cos + h * sin), newh = (int) Math.floor(h * cos + w * sin); + int width = image.getWidth(), height = image.getHeight(); + int newWidth = (int) Math.floor(width * cos + height * sin), newHeight = (int) Math.floor(height * cos + width * sin); GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); GraphicsDevice gs = ge.getDefaultScreenDevice(); GraphicsConfiguration gc = gs.getDefaultConfiguration(); - BufferedImage result = gc.createCompatibleImage(neww, newh, Transparency.TRANSLUCENT); + BufferedImage result = gc.createCompatibleImage(newWidth, newHeight, Transparency.TRANSLUCENT); Graphics2D g = result.createGraphics(); - g.translate((neww - w) / 2, (newh - h) / 2); - g.rotate(angle, w / 2, h / 2); + g.translate((newWidth - width) / 2, (newHeight - height) / 2); + g.rotate(angle, width / 2, height / 2); g.drawRenderedImage(image, null); g.dispose(); return result;