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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user