Browse Source

Changed svgIcon to not use deprecated api.

Signed-off-by: weisj <weisj@arcor.de>
pull/37/head
weisj 5 years ago
parent
commit
d1be0a97ea
  1. 2
      core/src/main/java/com/github/weisj/darklaf/icons/DarkSVGIcon.java
  2. 6
      core/src/test/java/icon/AllIcons.java

2
core/src/main/java/com/github/weisj/darklaf/icons/DarkSVGIcon.java

@ -58,7 +58,7 @@ public class DarkSVGIcon implements Icon, Serializable {
this.uri = uri;
size = new Dimension(displayWidth, displayHeight);
icon = new SVGIcon();
icon.setScaleToFit(true);
icon.setAutosize(SVGIcon.AUTOSIZE_STRETCH);
icon.setAntiAlias(true);
loaded = new AtomicBoolean(false);
}

6
core/src/test/java/icon/AllIcons.java

@ -95,10 +95,10 @@ public class AllIcons {
int SIZE = 30;
ThemedSVGIcon icon = (ThemedSVGIcon) IconLoader.get().loadSVGIcon(folder + "/" + f.getName(), SIZE, SIZE, true);
SVGIcon svgIcon = icon.getSVGIcon();
boolean scale = svgIcon.isScaleToFit();
svgIcon.setScaleToFit(false);
int autosize = svgIcon.getAutosize();
svgIcon.setAutosize(SVGIcon.AUTOSIZE_NONE);
icon.setDisplaySize(svgIcon.getIconWidth() * 2, svgIcon.getIconHeight() * 2);
svgIcon.setScaleToFit(scale);
svgIcon.setAutosize(autosize);
list.add(new Pair<>(f.getName(), icon));
}
}

Loading…
Cancel
Save