Fix determining DC area for wxDC with applied affine transformation
We need to take into account all aplied transformations (including affine transformation set with SetTransformMatrix()) while calculating entire DC area in logical coordinaates. For derived wxDC's that support affine transformations DeviceToLogical[Rel]() functions are overriden with platform-specific implementations taking into account all applied transformations (see documentation of wxDC::DeviceToLogical(), wxDC::DeviceToLogicalRel()) and they may be not equivalent to DeviceToLogical[Rel]{X|Y}().
This commit is contained in:
@@ -377,8 +377,7 @@ void wxDCImpl::DoSetClippingRegion(wxCoord x, wxCoord y, wxCoord w, wxCoord h)
|
|||||||
// of required clipping box and DC surface.
|
// of required clipping box and DC surface.
|
||||||
int dcWidth, dcHeight;
|
int dcWidth, dcHeight;
|
||||||
DoGetSize(&dcWidth, &dcHeight);
|
DoGetSize(&dcWidth, &dcHeight);
|
||||||
wxRect dcRect(DeviceToLogicalX(0), DeviceToLogicalY(0),
|
wxRect dcRect(DeviceToLogical(0, 0), DeviceToLogicalRel(dcWidth, dcHeight));
|
||||||
DeviceToLogicalXRel(dcWidth), DeviceToLogicalYRel(dcHeight));
|
|
||||||
clipRegion.Intersect(dcRect);
|
clipRegion.Intersect(dcRect);
|
||||||
|
|
||||||
m_clipping = true;
|
m_clipping = true;
|
||||||
@@ -400,10 +399,7 @@ void wxDCImpl::DoSetClippingRegion(wxCoord x, wxCoord y, wxCoord w, wxCoord h)
|
|||||||
wxRect wxDCImpl::GetLogicalArea() const
|
wxRect wxDCImpl::GetLogicalArea() const
|
||||||
{
|
{
|
||||||
const wxSize size = GetSize();
|
const wxSize size = GetSize();
|
||||||
return wxRect(DeviceToLogicalX(0),
|
return wxRect(DeviceToLogical(0, 0), DeviceToLogicalRel(size.x, size.y));
|
||||||
DeviceToLogicalY(0),
|
|
||||||
DeviceToLogicalXRel(size.x),
|
|
||||||
DeviceToLogicalYRel(size.y));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxDCImpl::DoGetClippingRect(wxRect& rect) const
|
bool wxDCImpl::DoGetClippingRect(wxRect& rect) const
|
||||||
|
Reference in New Issue
Block a user