mirror of
https://github.com/storytold/pdfcraft.git
synced 2026-11-19 10:35:59 +00:00
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:
1 parent
560acae86e
commit
9538640f56
1 file changed
+5
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user