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:
committed by
Vadim Zeitlin
parent
bd8c74f368
commit
c2a488ca42
@@ -627,6 +627,13 @@ bool wxHtmlWindow::LoadPage(const wxString& location)
|
|||||||
{
|
{
|
||||||
ScrollToAnchor(f->GetAnchor());
|
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;
|
delete f;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user