Retina fix removed from editor component

This commit is contained in:
Anton Makeev
2013-01-08 09:18:00 +01:00
parent cb47912508
commit 47187ba5b4
2 changed files with 12 additions and 15 deletions
@@ -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);
}