diff --git a/include/wx/dc.h b/include/wx/dc.h index 41f6d8212e..6dcf24c1c3 100644 --- a/include/wx/dc.h +++ b/include/wx/dc.h @@ -1014,6 +1014,14 @@ public: { return m_pimpl->DeviceToLogicalXRel(x); } wxCoord DeviceToLogicalYRel(wxCoord y) const { return m_pimpl->DeviceToLogicalYRel(y); } + wxPoint DeviceToLogical(const wxPoint& pt) const + { return m_pimpl->DeviceToLogical(pt.x, pt.y); } + wxPoint DeviceToLogical(wxCoord x, wxCoord y) const + { return m_pimpl->DeviceToLogical(x, y); } + wxSize DeviceToLogicalRel(const wxSize& dim) const + { return m_pimpl->DeviceToLogicalRel(dim.x, dim.y); } + wxSize DeviceToLogicalRel(int x, int y) const + { return m_pimpl->DeviceToLogicalRel(x, y); } wxCoord LogicalToDeviceX(wxCoord x) const { return m_pimpl->LogicalToDeviceX(x); } wxCoord LogicalToDeviceY(wxCoord y) const @@ -1022,6 +1030,14 @@ public: { return m_pimpl->LogicalToDeviceXRel(x); } wxCoord LogicalToDeviceYRel(wxCoord y) const { return m_pimpl->LogicalToDeviceYRel(y); } + wxPoint LogicalToDevice(const wxPoint& pt) const + { return m_pimpl->LogicalToDevice(pt.x, pt.y); } + wxPoint LogicalToDevice(wxCoord x, wxCoord y) const + { return m_pimpl->LogicalToDevice(x, y); } + wxSize LogicalToDeviceRel(const wxSize& dim) const + { return m_pimpl->LogicalToDeviceRel(dim.x, dim.y); } + wxSize LogicalToDeviceRel(int x, int y) const + { return m_pimpl->LogicalToDeviceRel(x, y); } void SetMapMode(wxMappingMode mode) { m_pimpl->SetMapMode(mode); } diff --git a/interface/wx/dc.h b/interface/wx/dc.h index 10a0392df5..fc1505ec21 100644 --- a/interface/wx/dc.h +++ b/interface/wx/dc.h @@ -283,6 +283,74 @@ public: */ wxCoord LogicalToDeviceYRel(wxCoord y) const; + /** + Converts device (@a x, @a y) coordinates to logical coordinates + taking into account all apllied transformations like the current + mapping mode, scale factors, device origin, axes orientation, + affine transformation. + + @since 3.1.5 + */ + wxPoint DeviceToLogical(wxCoord x, wxCoord y) const; + + /** + @overload + + @since 3.1.5 + */ + wxPoint DeviceToLogical(const wxPoint& pt) const; + + /** + Converts device @a x, @a y coordinates to relative logical coordinates + taking into account all apllied transformations like the current + mapping mode, scale factors, affine transformation. + Use this for converting distances like e.g. width and height. + + @since 3.1.5 + */ + wxSize DeviceToLogicalRel(int x, int y) const; + + /** + @overload + + @since 3.1.5 + */ + wxSize DeviceToLogicalRel(const wxSize& dim) const; + + /** + Converts logical (@a x, @a y) coordinates to device coordinates + taking into account all apllied transformations like the current + mapping mode, scale factors, device origin, axes orientation, + affine transformation. + + @since 3.1.5 + */ + wxPoint LogicalToDevice(wxCoord x, wxCoord y) const; + + /** + @overload + + @since 3.1.5 + */ + wxPoint LogicalToDevice(const wxPoint& pt) const; + + /** + Converts logical @a x, @a y coordinates to relative device coordinates + taking into account all apllied transformations like the current + mapping mode, scale factors, affine transformation. + Use this for converting distances like e.g. width and height. + + @since 3.1.5 + */ + wxSize LogicalToDeviceRel(int x, int y) const; + + /** + @overload + + @since 3.1.5 + */ + wxSize LogicalToDeviceRel(const wxSize& dim) const; + //@}