Rubberbanding is broken without these changes. Now, it's working correctly again under wxMSW, wxGTK3 and wxQt
https://github.com/user-attachments/assets/11cf2948-8c5e-4a11-8ae8-82a495400315
https://github.com/wxWidgets/wxWidgets/pull/26284
(4 files)
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
@vadz commented on this pull request.
You're the de factor RTL expert, so I can merge it if you're sure this is the right thing to do, but these changes seem very suspicious to me, i.e. I believe they work around some other bug(s) elsewhere and shouldn't be needed.
> @@ -92,7 +92,7 @@ StringFormat* gs_drawTextStringFormat = nullptr; // Get the string format used for the text drawing and measuring functions: // notice that it must be the same one for all of them, otherwise the drawn // text might be of different size than what measuring it returned. -inline StringFormat* GetDrawTextStringFormat(wxLayoutDirection dir = wxLayout_Default) +inline StringFormat* GetDrawTextStringFormat(bool isRTL = false)
I still hate bool parameters and would prefer to do this:
⬇️ Suggested change-inline StringFormat* GetDrawTextStringFormat(bool isRTL = false) +inline StringFormat* GetDrawTextStringFormat(DWORD layoutDir = 0)
(and check for layoutDir & LAYOUT_RTL below).
> + // For expected results, always perform drawing operations on an LTR HDC. + // A transformation matrix will be applied to this context to achieve the + // necessary mirroring effects. + ::SetLayout(hdc, 0);
I'm not sure what the expected results are, but it looks like using RTL HDC should give the same results as using LTR one and then transforming it, so it seems to me that there could still be another bug somewhere, if this is not the case...
> + // In RTL layout, ClientToScreen(0, 0) correctly returns the upper-right corner + // of the window (for non TLWs). But wxWidgets expects GetScreenPosition() to + // always return the upper-left corner instead to work with.
I think ClientToScreen(0,0) should indeed return the upper-right corner of the window when using RTL layout. Why/where do we rely on it being the upper-left corner?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()