diff --git a/packages/core/ui/gestures/index.ios.ts b/packages/core/ui/gestures/index.ios.ts index 49ab201a15..2ac7ee6c5e 100644 --- a/packages/core/ui/gestures/index.ios.ts +++ b/packages/core/ui/gestures/index.ios.ts @@ -591,7 +591,7 @@ class TouchGestureEventData implements TouchGestureEventData { if (!this._allPointers) { this._allPointers = []; - let nsArr = this.ios.event.allTouches.allObjects; + const nsArr = this.ios.event.allTouches.allObjects; for (let i = 0; i < nsArr.count; i++) { this._allPointers.push(new Pointer(nsArr.objectAtIndex(i), this.view)); } @@ -601,10 +601,14 @@ class TouchGestureEventData implements TouchGestureEventData { } getX(): number { - return this.getMainPointer().locationInView(this.view.nativeViewProtected).x; + const offset = this.view.nativeViewProtected.contentOffset; + const offsetX = offset ? offset.x : 0; + return this.getMainPointer().locationInView(this.view.nativeViewProtected).x - offsetX; } getY(): number { - return this.getMainPointer().locationInView(this.view.nativeViewProtected).y; + const offset = this.view.nativeViewProtected.contentOffset; + const offsetY = offset ? offset.y : 0; + return this.getMainPointer().locationInView(this.view.nativeViewProtected).y - offsetY; } }