ElyDoc: a page stays centred and zoom stays on the page; only a sheet grows past its size (R2.7)

This commit is contained in:
ZacharyZhang-NY committed 2026-10-09 02:38:46 -04:00
1 parent 9fe28f072b
commit 1b1148a410
3 files changed
+34 -3

No files matched your search

+5 -3
View File
@@ -49,9 +49,11 @@ impl LokView {
self.geom.twips_of(self.viewport.0) - fx,
self.geom.twips_of(self.viewport.1) - fy,
);
// Room past the target, in print twips for later zooms.
let need = self.print_of((x + w + vw + fx, y + h + vh + fy));
self.reach = (self.reach.0.max(need.0), self.reach.1.max(need.1));
// Only a sheet grows where it jumps; pages keep their size.
if self.sheet.is_some() {
let need = self.print_of((x + w + vw + fx, y + h + vh + fy));
self.reach = (self.reach.0.max(need.0), self.reach.1.max(need.1));
}
if x >= fx && (x < fx + self.scroll.0 || x + w > fx + self.scroll.0 + vw) {
self.scroll.0 = x - fx - vw / 2;
}