mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Retina fix removed from editor component
This commit is contained in:
+3
-9
@@ -148,15 +148,9 @@ public class EditorComponentImpl extends JComponent implements Scrollable, DataP
|
||||
myApplication.editorPaintStart();
|
||||
|
||||
try {
|
||||
UIUtil.paintWithRetina(getSize(), g, myEditor.paintBlockCaret(), new Consumer<Graphics2D>() {
|
||||
@Override
|
||||
public void consume(Graphics2D graphics) {
|
||||
UIUtil.setupComposite(graphics);
|
||||
|
||||
UISettings.setupAntialiasing(graphics);
|
||||
myEditor.paint(graphics);
|
||||
}
|
||||
});
|
||||
UIUtil.setupComposite((Graphics2D)g);
|
||||
UISettings.setupAntialiasing(g);
|
||||
myEditor.paint((Graphics2D)g);
|
||||
}
|
||||
finally {
|
||||
myApplication.editorPaintFinish();
|
||||
|
||||
@@ -1482,14 +1482,17 @@ public class UIUtil {
|
||||
return new BufferedImage(width, height, type);
|
||||
}
|
||||
|
||||
public static void paintWithRetina(@NotNull Dimension size, @NotNull Graphics g, Consumer<Graphics2D> paintRoutine) {
|
||||
paintWithRetina(size, g, true, paintRoutine);
|
||||
public static void paintWithXorOnRetina(@NotNull Dimension size, @NotNull Graphics g, Consumer<Graphics2D> paintRoutine) {
|
||||
paintWithXorOnRetina(size, g, true, paintRoutine);
|
||||
}
|
||||
|
||||
public static void paintWithRetina(@NotNull Dimension size,
|
||||
@NotNull Graphics g,
|
||||
boolean useRetinaCondition,
|
||||
Consumer<Graphics2D> paintRoutine) {
|
||||
/**
|
||||
* Direct painting into component's graphics with XORMode is broken on retina-mode so we need to paint into an intermediate buffer first.
|
||||
*/
|
||||
public static void paintWithXorOnRetina(@NotNull Dimension size,
|
||||
@NotNull Graphics g,
|
||||
boolean useRetinaCondition,
|
||||
Consumer<Graphics2D> paintRoutine) {
|
||||
if (!useRetinaCondition || !isRetina() || Registry.is("ide.mac.retina.disableDrawingFix", false)) {
|
||||
paintRoutine.consume((Graphics2D)g);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user