mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-23 05:58:26 +08:00
perf(animation): improves _progress() hot function
- progress() is the function where more time is spent during any swipe gesture - replace iterating over the _fx properties, using an array instead - optimize pointerCoord(), profiler showed it’s one of the most called functions
This commit is contained in:
@ -117,7 +117,7 @@ export class PanGesture {
|
||||
let coord = pointerCoord(ev);
|
||||
if (this.detector.detect(coord)) {
|
||||
|
||||
if (this.detector.pan() !== 0 && this.canCapture(ev) &&
|
||||
if (this.detector.pan() !== 0 &&
|
||||
(!this.gestute || this.gestute.capture())) {
|
||||
this.onDragStart(ev);
|
||||
this.captured = true;
|
||||
@ -156,7 +156,6 @@ export class PanGesture {
|
||||
|
||||
// Implemented in a subclass
|
||||
canStart(ev: any): boolean { return true; }
|
||||
canCapture(ev: any): boolean { return true; }
|
||||
onDragStart(ev: any) { }
|
||||
onDragMove(ev: any) { }
|
||||
onDragEnd(ev: any) { }
|
||||
|
Reference in New Issue
Block a user