Skip to content

Commit 12c7b2d

Browse files
committed
Finally
1 parent 8baabdf commit 12c7b2d

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

packages/react-native-gesture-handler/src/web/handlers/PinchGestureHandler.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,11 @@ export default class PinchGestureHandler extends GestureHandler {
7070
}
7171

7272
protected override transformNativeEvent() {
73+
const rect = this.delegate.measureView();
74+
7375
return {
74-
focalX: this.scaleGestureDetector.focusX,
75-
focalY: this.scaleGestureDetector.focusY,
76+
focalX: this.scaleGestureDetector.focusX - rect.pageX,
77+
focalY: this.scaleGestureDetector.focusY - rect.pageY,
7678
velocity: this.velocity,
7779
scale: this.scale,
7880
};

packages/react-native-gesture-handler/src/web/handlers/RotationGestureHandler.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,12 @@ export default class RotationGestureHandler extends GestureHandler {
6666
}
6767

6868
protected override transformNativeEvent() {
69+
const rect = this.delegate.measureView();
70+
6971
return {
7072
rotation: this.rotation ? this.rotation : 0,
71-
anchorX: this.getAnchorX(),
72-
anchorY: this.getAnchorY(),
73+
anchorX: this.getAnchorX() - rect.pageX,
74+
anchorY: this.getAnchorY() - rect.pageY,
7375
velocity: this.velocity ? this.velocity : 0,
7476
};
7577
}

0 commit comments

Comments
 (0)