Fix scroll position after following a link in wxHtmlWindow

When not using an anchor, new page must be shown starting from its
origin in the top-left corner, instead of remaining at the current
scroll position, as it did before.

Closes #18922.
This commit is contained in:
Andy Robinson
2020-11-04 17:44:02 +01:00
committed by Vadim Zeitlin
parent bd8c74f368
commit c2a488ca42

View File

@@ -627,6 +627,13 @@ bool wxHtmlWindow::LoadPage(const wxString& location)
{
ScrollToAnchor(f->GetAnchor());
}
else
{
// Without anchor, go to the top of the page, instead of
// possibly remaining at non-zero scroll position and scrolling
// the top out of view.
Scroll(0, 0);
}
delete f;