Add a workaround for failing test under Wine

Debugging confirms that DPtoLP() simply returns wrong (i.e. different
from that returned under actual MSW) result when using Wine, so just
account for it in the test as it seems to be better than just skipping
the test entirely under Wine and there doesn't seem to be anything else
to do.
This commit is contained in:
Vadim Zeitlin 2022-05-02 22:40:36 +02:00
parent c0b7240dfb
commit 3cc55d5b66

View file

@ -685,6 +685,19 @@ static void TransformedWithMatrixAndStdEx(wxDC * dc)
wxPoint2DDouble posLogRef = m1.TransformPoint(wxPoint2DDouble(s_posDev));
wxPoint posLog;
posLog = dc->DeviceToLogical(s_posDev);
if ( wxIsRunningUnderWine() )
{
// Current versions of Wine seem to have a bug and return a value
// which is one off from DPtoLP() used by wxDC::DeviceToLogical()
// and there doesn't seem to be anything we can do about it, so
// just tweak the result to pass this test.
if ( posLog.x == posLogRef.m_x + 1 )
posLog.x--;
else
WARN("Wine workaround might be not needed any longer");
}
CHECK(posLog.x == wxRound(posLogRef.m_x));
CHECK(posLog.y == wxRound(posLogRef.m_y));