mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
fix(ios): gesture touch event coordinates improvements (#8998)
This commit is contained in:
committed by
Nathan Walker
parent
d5a8a25aba
commit
d46f9562b4
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user