X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a3873c6f9ce96d50e0ea93539bb670518ad5fa88..7db064f60f2d60bcfea44a9973a18e6c2bf2161d:/src/html/htmlwin.cpp diff --git a/src/html/htmlwin.cpp b/src/html/htmlwin.cpp index 86e997045a..636a07610f 100644 --- a/src/html/htmlwin.cpp +++ b/src/html/htmlwin.cpp @@ -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();