Skip to content
This repository has been archived by the owner on Mar 31, 2023. It is now read-only.

Commit

Permalink
perf(praparat): disable will-change switching process
Browse files Browse the repository at this point in the history
  • Loading branch information
itigoore01 committed Oct 3, 2019
1 parent d32f69b commit 0ae51b2
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 11 deletions.
1 change: 0 additions & 1 deletion projects/praparat/src/lib/praparat.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,4 @@

.praparat-zoom-element {
transform-origin: 0 0;
// will-change: transform;
}
10 changes: 0 additions & 10 deletions projects/praparat/src/lib/praparat.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,16 +179,6 @@ export class PraparatComponent implements OnDestroy, AfterViewInit {
).subscribe(([scale, pan]) => {
this.renderer.setStyle(this.zoomElement.nativeElement, 'transform', `scale(${scale}) translate3d(${pan.x}px, ${pan.y}px, 0px)`);
});

panZoomObservable$.pipe(
debounceTime(100, animationFrameScheduler),
takeUntil(this.destroyed),
).subscribe(() => {
this.renderer.setStyle(this.zoomElement.nativeElement, 'will-change', 'auto');
setTimeout(() => {
this.renderer.removeStyle(this.zoomElement.nativeElement, 'will-change');
}, 0);
});
});
}

Expand Down

0 comments on commit 0ae51b2

Please sign in to comment.