From ebc9ca08206c60fed6d8d5eba5e1f5ad4c8ef70c Mon Sep 17 00:00:00 2001 From: Konstantin Bulenkov Date: Tue, 1 Mar 2016 13:22:26 +0100 Subject: [PATCH] + scale(int):int method --- platform/util/src/com/intellij/util/ui/EmptyIcon.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/platform/util/src/com/intellij/util/ui/EmptyIcon.java b/platform/util/src/com/intellij/util/ui/EmptyIcon.java index 2d08af300fdf..b77ddba23dfa 100644 --- a/platform/util/src/com/intellij/util/ui/EmptyIcon.java +++ b/platform/util/src/com/intellij/util/ui/EmptyIcon.java @@ -80,12 +80,12 @@ public class EmptyIcon implements Icon, ScalableIcon { @Override public int getIconWidth() { - return scale == 1f ? width : (int) (width * scale); + return scale(width); } @Override public int getIconHeight() { - return scale == 1f ? height : (int) (height * scale); + return scale(height); } @Override @@ -117,6 +117,10 @@ public class EmptyIcon implements Icon, ScalableIcon { return new EmptyIconUIResource(this); } + protected int scale(int n) { + return scale == 1f ? n : (int) (n * scale); + } + @Override public Icon scale(float scaleFactor) { if (scaleFactor != scale) {