fix(ui): a bookmark made in the page grid goes to the current page (#5636)

The grid moves the viewport without refreshing where the pages are on screen, so
bookmark_position now gives no position there.
This commit is contained in:
RiceDee committed 2026-11-01 19:19:23 +11:00
1 parent 560acae86e
commit 9538640f56
1 file changed
+5
+5
View File
@@ -9,6 +9,11 @@ impl DocView {
/// zoom are kept). `None` before the first frame has laid pages out, when the bookmark just
/// goes to the current page.
pub(crate) fn bookmark_position(&self, info: &DocInfo) -> Option<(usize, [Option<f32>; 2])> {
// The page grid moves the viewport without refreshing where the pages are on screen, so
// there is no position to read: the bookmark goes to the current page.
if self.organize {
return None;
}
if let Some(sel) = self.selection
&& let Some(text) = self.texts.get(&sel.page)
&& let Some(p) = info.pages.get(sel.page)