fix(ios): gesture touch event coordinates improvements (#8998)

This commit is contained in:
Sergey Mell
2021-01-29 22:52:05 +02:00
committed by Nathan Walker
parent d5a8a25aba
commit d46f9562b4

View File

@@ -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;
}
}