From e9bb4e80cbf784f0d85f7c5f4a1abc022a844511 Mon Sep 17 00:00:00 2001 From: AliKet Date: Tue, 11 Jan 2022 02:50:37 +0100 Subject: [PATCH] Fix wxStaticBox repainting in RTL layout under MSW Calculate the clipping region correctly when repainting a wxStaticBox containing windows that are its siblings (rather than children) when RTL layout is used: the old AdjustRectForRtl() implementation didn't mirror the child coordinates correctly. See #19086. --- src/msw/statbox.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/msw/statbox.cpp b/src/msw/statbox.cpp index 6fa9a0c6b1..07e6d95f24 100644 --- a/src/msw/statbox.cpp +++ b/src/msw/statbox.cpp @@ -374,8 +374,8 @@ RECT AdjustRectForRtl(wxLayoutDirection dir, RECT const& childRect, RECT const& // The clipping region too is mirrored in RTL layout. // We need to mirror screen coordinates relative to static box window priot to // intersecting with region. - ret.right = boxRect.right - childRect.left - boxRect.left; - ret.left = boxRect.right - childRect.right - boxRect.left; + ret.right = boxRect.right - (childRect.left - boxRect.left); + ret.left = boxRect.left + (boxRect.right - childRect.right); } return ret;