Implement platform-specific coordinate conversion functions

Generic wxDC::DeviceToLogicalRel{X|Y}() and wxDC::LogicalToDeviceRel{X|Y}()
functions don't take into account scaling applied with
wxDC::SetTransformMatrix().
We need to implement in wxDCImpl and its platform-specific derivates
new conversion functions that take all applied transformations into account.

See #18923.
This commit is contained in:
Artur Wieczorek
2020-09-27 10:38:08 +02:00
parent 6fac6c0b35
commit 2c3c841719
6 changed files with 54 additions and 0 deletions

View File

@@ -512,6 +512,16 @@ wxPoint wxDCImpl::LogicalToDevice(wxCoord x, wxCoord y) const
return wxPoint(LogicalToDeviceX(x), LogicalToDeviceY(y));
}
wxSize wxDCImpl::DeviceToLogicalRel(int x, int y) const
{
return wxSize(DeviceToLogicalXRel(x), DeviceToLogicalYRel(y));
}
wxSize wxDCImpl::LogicalToDeviceRel(int x, int y) const
{
return wxSize(LogicalToDeviceXRel(x), LogicalToDeviceYRel(y));
}
void wxDCImpl::ComputeScaleAndOrigin()
{
m_scaleX = m_logicalScaleX * m_userScaleX;