HiDPI: fixed occasional wrong repaint areas when using HiDPIUtils.installHiDPIRepaintManager() (see PR #864)

This commit is contained in:
Karl Tauber
2024-08-04 15:14:46 +02:00
parent 97b21bfa8b
commit d27e0561f2
2 changed files with 4 additions and 2 deletions

View File

@@ -521,12 +521,12 @@ public class HiDPIUtils
int x2 = x + c.getX();
int y2 = y + c.getY();
for( Component p = c.getParent(); p != null; p = p.getParent() ) {
x2 += p.getX();
y2 += p.getY();
if( x2 + width < p.getWidth() && y2 + height < p.getHeight() && p instanceof JComponent ) {
callback.addDirtyRegion( (JComponent) p, x2, y2, width, height );
return;
}
x2 += p.getX();
y2 += p.getY();
}
}