Also fix custom drawing where wxDC::DeviceToLogical() and related functions need to be used.
https://github.com/wxWidgets/wxWidgets/pull/26398
(3 files)
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
@AliKet pushed 1 commit.
—
View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
I don't have a real explanation of why we need this commit da9c92e to fix tests failures in OneDevRegionRTL, Just some weired rounding errors? I'm guessing...
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
Micro-optimisation:
diff --git a/src/msw/dc.cpp b/src/msw/dc.cpp index dc56fa3e53..dda510a168 100644 --- a/src/msw/dc.cpp +++ b/src/msw/dc.cpp @@ -2379,10 +2379,12 @@ bool wxMSWDCImpl::DoStretchBlit(wxCoord xdest, wxCoord ydest, // automatically as it doesn't even work with the source HDC. // So do this manually to ensure that the coordinates are // interpreted in the same way here as in all the other cases. - xsrc = source->LogicalToDeviceX(xsrcOrig); - ysrc = source->LogicalToDeviceY(ysrcOrig); - srcWidth = source->LogicalToDeviceXRel(srcWidth); - srcHeight = source->LogicalToDeviceYRel(srcHeight); + const auto devPos = implSrc->LogicalToDevice(xsrcOrig, ysrcOrig); + const auto devSize = implSrc->LogicalToDeviceRel(srcWidth, srcHeight); + xsrc = devPos.x; + ysrc = devPos.y; + srcWidth = devSize.x; + srcHeight = devSize.y; // Figure out what co-ordinate system we're supposed to specify // ysrc in.
LogicalToDevice{X,Y}[Rel]() now internally call SetLayout() to force LTR before calling LPtoDP() as a pre-condition and restore the old layout when the function returns as a post-condition. So there will be 8 calls to SetLayout() with the old code, but 4 with the patch above. I didn't try to profile this to see whether the patch makes any difference, but I still prefer to apply it, though.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
@vslavik I would be grateful if you could test this and see whether it breaks something I’m not aware of. Thanks in advance!
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()