Use wxDCClipper in wxHtmlDCRenderer code

Use wxDCClipper instead of manually calling DestroyClippingRegion().
This is simpler and safer and also potentially more correct as
wxDCClipper restores the previous clipping region, if any, unlike the
old code -- even though this probably doesn't matter here as the
printing DC seems unlikely to be clipped.
This commit is contained in:
Vadim Zeitlin
2018-05-23 17:22:54 +02:00
parent 9fa9880f97
commit b6f0693a41

View File

@@ -161,12 +161,11 @@ int wxHtmlDCRenderer::Render(int x, int y,
wxDefaultHtmlRenderingStyle rstyle;
rinfo.SetStyle(&rstyle);
m_DC->SetBrush(*wxWHITE_BRUSH);
m_DC->SetClippingRegion(x, y, m_Width, hght);
wxDCClipper clip(*m_DC, x, y, m_Width, hght);
m_Cells->Draw(*m_DC,
x, (y - from),
y, y + hght,
rinfo);
m_DC->DestroyClippingRegion();
}
if (pbreak < m_Cells->GetHeight()) return pbreak;