From b835e9bf4940cc1027c0ab364816bfd4aa229a72 Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Thu, 15 Nov 2001 23:54:16 +0000 Subject: [PATCH] optimalization of wxHtmlWindow painting (used to repaint areas invalidated when scrolling 3+ times) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12437 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/html/htmlwin.cpp | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/src/html/htmlwin.cpp b/src/html/htmlwin.cpp index 0f5fc11366..7d79fe5523 100644 --- a/src/html/htmlwin.cpp +++ b/src/html/htmlwin.cpp @@ -632,23 +632,18 @@ void wxHtmlWindow::OnCellMouseHover(wxHtmlCell * WXUNUSED(cell), void wxHtmlWindow::OnDraw(wxDC& dc) { - int x, y; - wxRegionIterator upd(GetUpdateRegion()); // get the update rect list - int v_y, v_h; + if (m_tmpCanDrawLocks > 0 || m_Cell == NULL) return; - if (m_tmpCanDrawLocks > 0) return; + int x, y; + wxRect rect = GetUpdateRegion().GetBox(); dc.SetMapMode(wxMM_TEXT); dc.SetBackgroundMode(wxTRANSPARENT); GetViewStart(&x, &y); - while (upd) - { - v_y = upd.GetY(); - v_h = upd.GetH(); - if (m_Cell) m_Cell->Draw(dc, 0, 0, y * wxHTML_SCROLL_STEP + v_y, y * wxHTML_SCROLL_STEP + v_h + v_y); - upd++; - } + m_Cell->Draw(dc, 0, 0, + y * wxHTML_SCROLL_STEP + rect.GetTop(), + y * wxHTML_SCROLL_STEP + rect.GetBottom()); } @@ -785,4 +780,4 @@ IMPLEMENT_DYNAMIC_CLASS(wxHtmlWinModule, wxModule) #include "wx/html/forcelnk.h" FORCE_WXHTML_MODULES() -#endif \ No newline at end of file +#endif -- 2.45.2