mirror of
https://github.com/john-okeefe/foliate-js.git
synced 2026-09-09 11:29:14 -04:00
Add scroll position and source context to zoom/pan event data in FixedLayout
This commit enhances the FixedLayout component by including additional contextual information when zoom or pan operations occur: - scrollLeft and scrollTop: Current scroll position of the viewport - source: Origin of the zoom/pan action (e.g., mouse wheel, pinch zoom, button) - leftWidth: Width of the left page/panel in dual-page layouts These parameters provide downstream handlers with complete state information needed to implement sophisticated zoom behaviors, such as: - Preserving scroll position during zoom operations - Differentiating between user-initiated and programmatic zoom changes - Handling asymmetric layouts with different panel widths This change is part of the ongoing zoom control implementation for fixed-layout e-books.
This commit is contained in:
@@ -288,8 +288,12 @@ export class FixedLayout extends HTMLElement {
|
||||
cursorY,
|
||||
dragOffsetX: this.dragOffset.x,
|
||||
dragOffsetY: this.dragOffset.y,
|
||||
scrollLeft: this.scrollLeft,
|
||||
scrollTop: this.scrollTop,
|
||||
newScrollX,
|
||||
newScrollY,
|
||||
source,
|
||||
leftWidth,
|
||||
});
|
||||
// Apply zoom
|
||||
this.setAttribute("zoom", newScale);
|
||||
|
||||
Reference in New Issue
Block a user