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

@@ -11,6 +11,8 @@ FlatLaf Change Log
- Popup: Fixed `UnsupportedOperationException: PERPIXEL_TRANSLUCENT translucency - Popup: Fixed `UnsupportedOperationException: PERPIXEL_TRANSLUCENT translucency
is not supported` exception on Haiku OS when showing popup (partly) outside of is not supported` exception on Haiku OS when showing popup (partly) outside of
window. (issue #869) window. (issue #869)
- HiDPI: Fixed occasional wrong repaint areas when using
`HiDPIUtils.installHiDPIRepaintManager()`. (see PR #864)
## 3.5 ## 3.5

View File

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