]> git.saurik.com Git - wxWidgets.git/blobdiff - src/html/htmlwin.cpp
Added typeinfo.h which implements wxTypeId, using C++ RTTI if available. wxAny and...
[wxWidgets.git] / src / html / htmlwin.cpp
index 86e997045a0f5f737df50fec9ae31599054d7340..636a07610f699b55e6b2113f5e774264aa207dde 100644 (file)
@@ -657,6 +657,16 @@ bool wxHtmlWindow::ScrollToAnchor(const wxString& anchor)
     }
     else
     {
+        // Go to next visible cell in current container, if it exists. This
+        // yields a bit better (even though still imperfect) results in that
+        // there's better chance of using a suitable cell for upper Y
+        // coordinate value. See bug #11406 for additional discussion.
+        const wxHtmlCell *c_save = c;
+        while ( c && c->IsFormattingCell() )
+            c = c->GetNext();
+        if ( !c )
+            c = c_save;
+
         int y;
 
         for (y = 0; c != NULL; c = c->GetParent()) y += c->GetPosY();