Skip to content

Commit

Permalink
FlatSVGIcon: no longer use classes from package `com.formdev.flatlaf.…
Browse files Browse the repository at this point in the history
…ui` to allow using FlatSVGIcon (and flatlaf-extras.jar) in NetBeans plugin (NetBeans ships with FlatLaf, but does not export that package)
  • Loading branch information
DevCharly committed Nov 14, 2022
1 parent 3e6bce9 commit aefe104
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
import com.formdev.flatlaf.FlatIconColors;
import com.formdev.flatlaf.FlatLaf;
import com.formdev.flatlaf.FlatLaf.DisabledIconProvider;
import com.formdev.flatlaf.ui.FlatUIUtils;
import com.formdev.flatlaf.util.Graphics2DProxy;
import com.formdev.flatlaf.util.GrayFilter;
import com.formdev.flatlaf.util.LoggingFacade;
Expand Down Expand Up @@ -584,7 +583,11 @@ public void paintIcon( Component c, Graphics g, int x, int y ) {
Graphics2D g2 = new GraphicsFilter( (Graphics2D) g.create(), colorFilter, ColorFilter.getInstance(), grayFilter );

try {
FlatUIUtils.setRenderingHints( g2 );
// same hints as in FlatUIUtils.setRenderingHints()
g2.setRenderingHint( RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON );
g2.setRenderingHint( RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_NORMALIZE );

// enable better image scaling
g2.setRenderingHint( RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR );

paintSvg( g2, x, y );
Expand Down

0 comments on commit aefe104

Please sign in to comment.