]> git.saurik.com Git - wxWidgets.git/blobdiff - src/html/htmlwin.cpp
added a preImage of the selection in order to avoid unnecessary events being triggered
[wxWidgets.git] / src / html / htmlwin.cpp
index ada2a4d19e587ff54bf62ac82017900994c7849e..7d79fe5523c97a1d7de1c31ea4af8f642d1cb929 100644 (file)
@@ -618,7 +618,7 @@ void wxHtmlWindow::OnLinkClicked(const wxHtmlLinkInfo& link)
 void wxHtmlWindow::OnCellClicked(wxHtmlCell *cell,
                                  wxCoord x, wxCoord y,
                                  const wxMouseEvent& event)
-{ 
+{
     wxCHECK_RET( cell, _T("can't be called with NULL cell") );
 
     cell->OnMouseClick(this, x, y, event);
@@ -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());
 }