From d27e0561f29ca10384a163e3462797a740e816e7 Mon Sep 17 00:00:00 2001 From: Karl Tauber Date: Sun, 4 Aug 2024 15:14:46 +0200 Subject: [PATCH] HiDPI: fixed occasional wrong repaint areas when using `HiDPIUtils.installHiDPIRepaintManager()` (see PR #864) --- CHANGELOG.md | 2 ++ .../src/main/java/com/formdev/flatlaf/util/HiDPIUtils.java | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 80d21b45..2ff6cf1a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,8 @@ FlatLaf Change Log - Popup: Fixed `UnsupportedOperationException: PERPIXEL_TRANSLUCENT translucency is not supported` exception on Haiku OS when showing popup (partly) outside of window. (issue #869) +- HiDPI: Fixed occasional wrong repaint areas when using + `HiDPIUtils.installHiDPIRepaintManager()`. (see PR #864) ## 3.5 diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/util/HiDPIUtils.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/util/HiDPIUtils.java index eefc15d3..21976798 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/util/HiDPIUtils.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/util/HiDPIUtils.java @@ -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(); } }