Fixed blinking of display

This commit is contained in:
Jindra Petřík
2022-12-17 17:16:56 +01:00
parent 5962aa8183
commit 4ddba88972

View File

@@ -1507,7 +1507,6 @@ public final class ImagePanel extends JPanel implements MediaDisplay {
VolatileImage ri = this.renderImage;
if (ri != null) {
calcRect();
if (ri.validate(View.getDefaultConfiguration()) != VolatileImage.IMAGE_OK) {
ri = View.createRenderImage(getWidth(), getHeight(), Transparency.TRANSLUCENT);
render();
@@ -1516,15 +1515,14 @@ public final class ImagePanel extends JPanel implements MediaDisplay {
if (ri != null) {
g2d.drawImage(ri, 0, 0, null);
}
}
g2d.setColor(Color.red);
DecimalFormat df = new DecimalFormat();
df.setMaximumFractionDigits(2);
df.setMinimumFractionDigits(0);
df.setGroupingUsed(false);
}
if (Configuration._debugMode.get()) {
g2d.setColor(Color.red);
DecimalFormat df = new DecimalFormat();
df.setMaximumFractionDigits(2);
df.setMinimumFractionDigits(0);
df.setGroupingUsed(false);
g2d.drawString("frameLoss:" + df.format(getFrameLoss()) + "%", 20, 20);
}
}