mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-11 01:32:08 +10:00
painting optimization
This commit is contained in:
+4
-6
@@ -128,18 +128,16 @@ class CanvasPanel extends JComponent implements Autoscroll {
|
|||||||
if (volatileImage.contentsLost()) {
|
if (volatileImage.contentsLost()) {
|
||||||
createBufferImage();
|
createBufferImage();
|
||||||
}
|
}
|
||||||
int validation = volatileImage.validate(screenGraphicsConfiguration);
|
// int validation = volatileImage.validate(screenGraphicsConfiguration);
|
||||||
if (validation == VolatileImage.IMAGE_INCOMPATIBLE) {
|
// if (validation == VolatileImage.IMAGE_INCOMPATIBLE) {
|
||||||
createBufferImage();
|
// createBufferImage();
|
||||||
}
|
// }
|
||||||
g.drawImage(bufferImage, 0, 0, this);
|
g.drawImage(bufferImage, 0, 0, this);
|
||||||
} catch (NullPointerException e) {
|
} catch (NullPointerException e) {
|
||||||
createBufferImage();
|
createBufferImage();
|
||||||
}
|
}
|
||||||
} while (volatileImage == null || volatileImage.contentsLost());
|
} while (volatileImage == null || volatileImage.contentsLost());
|
||||||
} else {
|
} else {
|
||||||
Graphics2D g2d = (Graphics2D) bufferImage.getGraphics();
|
|
||||||
plugInPort.draw(g2d, DRAW_OPTIONS, null);
|
|
||||||
g.drawImage(bufferImage, 0, 0, this);
|
g.drawImage(bufferImage, 0, 0, this);
|
||||||
bufferImage.flush();
|
bufferImage.flush();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user