From 9e6debbf6e6e30b3106008142306bdca5949307d Mon Sep 17 00:00:00 2001 From: Nathanael Anderson Date: Tue, 13 Oct 2020 14:42:46 -0500 Subject: [PATCH 1/2] Update bug_report.md --- .github/ISSUE_TEMPLATE/bug_report.md | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 5ef9b1bb07..810b02be0d 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -12,6 +12,7 @@ Provide version numbers for the following components (information can be retriev - Cross-platform modules: - Android Runtime: - iOS Runtime: + - XCode Version: - Plugin(s): **Describe the bug** From d8ba0989b1da87d770952c8f683c584be1acabd6 Mon Sep 17 00:00:00 2001 From: Sergey Mell Date: Fri, 30 Oct 2020 21:58:52 +0200 Subject: [PATCH 2/2] fix(ios/ui/gestures): change touch event coordinates determination Do not determine touch event coordinates in consistent ios/android way https://github.com/NativeScript/NativeScript/issues/5976 --- packages/core/ui/gestures/index.ios.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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; } }