diff --git a/projects/praparat/src/lib/praparat-config.ts b/projects/praparat/src/lib/praparat-config.ts index 369b460..e2d1d82 100644 --- a/projects/praparat/src/lib/praparat-config.ts +++ b/projects/praparat/src/lib/praparat-config.ts @@ -7,6 +7,7 @@ export interface PraparatConfig { wheelZoomFactor: number; maxScale: number; minScale: number; + willChangeDebounceTime: number; } export function createPrapratConfig(config: Partial = {}): PraparatConfig { @@ -15,7 +16,8 @@ export function createPrapratConfig(config: Partial = {}): Prapa initialPan = { x: 0, y: 0 }, wheelZoomFactor = 0.01, maxScale = 100, - minScale = 0.01 + minScale = 0.01, + willChangeDebounceTime = 300, } = config; return { @@ -24,6 +26,7 @@ export function createPrapratConfig(config: Partial = {}): Prapa wheelZoomFactor, maxScale, minScale, + willChangeDebounceTime, }; } diff --git a/projects/praparat/src/lib/praparat.component.ts b/projects/praparat/src/lib/praparat.component.ts index dc1520a..93beabd 100644 --- a/projects/praparat/src/lib/praparat.component.ts +++ b/projects/praparat/src/lib/praparat.component.ts @@ -190,7 +190,7 @@ export class PraparatComponent implements OnDestroy, AfterViewInit { }); panZoomObservable$.pipe( - debounceTime(300), + debounceTime(this.defaultConfig.willChangeDebounceTime), takeUntil(this.destroyed), ).subscribe(() => { if (this.animating.value) {