File tree Expand file tree Collapse file tree
packages/react-native-gesture-handler/src/web/handlers Expand file tree Collapse file tree Original file line number Diff line number Diff 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 } ;
Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments