mirror of
https://github.com/wxWidgets/wxWidgets.git
synced 2026-08-20 22:06:25 +08:00
Both DeviceToLogical{X,Y}() and DeviceToLogical() taking wxPoint were
virtual, with the latter implemented in terms of the former by default,
which meant that overriding only that function, but not the ones taking
X/Y coordinates individually, could result in inconsistent behaviour,
which is exactly what happened in wxMSW.
Make it impossible for this to happen by only allowing to override the
functions taking wxPoint (or wxSize for "relative" variant) and
reimplementing the functions working with individual components in terms
of the virtual functions.
The same goes for LogicalToDevice() and "Rel" variants.
As an important side effect, this fixes a bug in wxDC::StretchBlit() in
wxMSW when using RTL layout as the code there used LogicalToDevice{X,Y}
functions that didn't return the correct values before this commit.
Update the tests to not test for the wrong behaviour of per-coordinate
translation functions now that they behave correctly. Also remove the
tests checking that per-coordinate translation doesn't work when the
transformation matrix includes a rotational component.
Update the documentation to emphasize that converting both coordinates
at once is preferred.
See #19344, #26266.