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:
@@ -613,6 +613,22 @@ wxPoint wxGCDCImpl::LogicalToDevice(wxCoord x, wxCoord y) const
|
||||
return wxPoint(wxRound(px), wxRound(py));
|
||||
}
|
||||
|
||||
wxSize wxGCDCImpl::DeviceToLogicalRel(int x, int y) const
|
||||
{
|
||||
wxDouble dx = x;
|
||||
wxDouble dy = y;
|
||||
m_matrixCurrentInv.TransformDistance(&dx, &dy);
|
||||
return wxSize(wxRound(dx), wxRound(dy));
|
||||
}
|
||||
|
||||
wxSize wxGCDCImpl::LogicalToDeviceRel(int x, int y) const
|
||||
{
|
||||
wxDouble dx = x;
|
||||
wxDouble dy = y;
|
||||
m_matrixCurrent.TransformDistance(&dx, &dy);
|
||||
return wxSize(wxRound(dx), wxRound(dy));
|
||||
}
|
||||
|
||||
bool wxGCDCImpl::DoFloodFill(wxCoord WXUNUSED(x), wxCoord WXUNUSED(y),
|
||||
const wxColour& WXUNUSED(col),
|
||||
wxFloodFillStyle WXUNUSED(style))
|
||||
|
Reference in New Issue
Block a user