X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/58bd6224acb5b8dce46abbc3f3df7eae346c9859..ed4eede6c2c16cdb422a39c1b3655956b8f51a1c:/src/html/htmprint.cpp diff --git a/src/html/htmprint.cpp b/src/html/htmprint.cpp index c094e0ead3..ce67a52c69 100644 --- a/src/html/htmprint.cpp +++ b/src/html/htmprint.cpp @@ -112,7 +112,9 @@ void wxHtmlDCRenderer::SetStandardFonts(int size, } -int wxHtmlDCRenderer::Render(int x, int y, int from, int dont_render, int to, int *known_pagebreaks, int number_of_pages) +int wxHtmlDCRenderer::Render(int x, int y, int from, int dont_render, + int maxHeight, + int *known_pagebreaks, int number_of_pages) { int pbreak, hght; @@ -121,9 +123,8 @@ int wxHtmlDCRenderer::Render(int x, int y, int from, int dont_render, int to, in pbreak = (int)(from + m_Height); while (m_Cells->AdjustPagebreak(&pbreak, known_pagebreaks, number_of_pages)) {} hght = pbreak - from; - if(to < hght) - hght = to; - + if (maxHeight < hght) + hght = maxHeight; if (!dont_render) { @@ -131,10 +132,12 @@ int wxHtmlDCRenderer::Render(int x, int y, int from, int dont_render, int to, in wxDefaultHtmlRenderingStyle rstyle; rinfo.SetStyle(&rstyle); m_DC->SetBrush(*wxWHITE_BRUSH); + m_DC->SetClippingRegion(x, y, m_Width, hght); m_Cells->Draw(*m_DC, x, (y - from), - y, y + hght, + y, pbreak + (y /*- from*/), rinfo); + m_DC->DestroyClippingRegion(); } if (pbreak < m_Cells->GetHeight()) return pbreak;