JBR-5946 Allow to disable painting of composed text in Swing text components using TextLayout.draw

(cherry picked from commit 3ac357417b)
This commit is contained in:
Dmitry Batrak
2023-08-16 12:28:25 +03:00
committed by jbrbot
parent 056b40af05
commit fa07d3193e

View File

@@ -1003,7 +1003,11 @@ public class SwingUtilities2 {
} else {
layout = new TextLayout(iterator, frc);
}
layout.draw(g2d, x, y);
if (Boolean.TRUE.equals(Toolkit.getDefaultToolkit().getDesktopProperty("jb.swing.avoid.text.layout"))) {
g2d.drawString(iterator, x, y);
} else {
layout.draw(g2d, x, y);
}
retVal = layout.getAdvance();
}