+ scale(int):int method

This commit is contained in:
Konstantin Bulenkov
2016-03-01 13:45:38 +01:00
parent 6af1c78032
commit ebc9ca0820
@@ -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) {