|
|
|
@ -35,11 +35,11 @@ import javax.swing.*;
|
|
|
|
|
import javax.swing.plaf.basic.BasicHTML; |
|
|
|
|
import javax.swing.text.View; |
|
|
|
|
|
|
|
|
|
import sun.swing.SwingUtilities2; |
|
|
|
|
|
|
|
|
|
import com.github.weisj.darklaf.ui.OpacityBufferedUI; |
|
|
|
|
import com.github.weisj.darklaf.util.*; |
|
|
|
|
|
|
|
|
|
import sun.swing.SwingUtilities2; |
|
|
|
|
|
|
|
|
|
public class StringPainter { |
|
|
|
|
|
|
|
|
|
private static final Logger LOGGER = LogUtil.getLogger(StringPainter.class); |
|
|
|
@ -264,9 +264,16 @@ public class StringPainter {
|
|
|
|
|
return g; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public static void paintOpacityBuffered(final Graphics g, final JComponent c, final OpacityBufferedUI ui) { |
|
|
|
|
public static void paintOpacityBufferedUI(final Graphics g, final JComponent c, final OpacityBufferedUI ui) { |
|
|
|
|
boolean opaqueBuffered = translucentAAPaintingEnabled && GraphicsUtil.isOpaqueBuffered(c); |
|
|
|
|
if (opaqueBuffered) { |
|
|
|
|
paintOpacityBuffered(g, c, ui); |
|
|
|
|
} else { |
|
|
|
|
ui.updateUI(g, c); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public static void paintOpacityBuffered(final Graphics g, final JComponent c, final OpacityBufferedUI ui) { |
|
|
|
|
double scaleX = Scale.getScaleX((Graphics2D) g); |
|
|
|
|
double scaleY = Scale.getScaleX((Graphics2D) g); |
|
|
|
|
BufferedImage img = ImageUtil.createCompatibleImage((int) Math.round(scaleX * c.getWidth()), |
|
|
|
@ -279,8 +286,5 @@ public class StringPainter {
|
|
|
|
|
ui.updateUI(imgGraphics, c); |
|
|
|
|
imgGraphics.dispose(); |
|
|
|
|
g.drawImage(img, 0, 0, c.getWidth(), c.getHeight(), null); |
|
|
|
|
} else { |
|
|
|
|
ui.updateUI(g, c); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|