react-native-gesture-handler 2.30.0-nightly-20251217-6e8646aea → 2.30.0-nightly-20251217-6dddda826
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/apple/Handlers/RNPinchHandler.m +17 -10
- package/package.json +1 -1
|
@@ -163,21 +163,28 @@
|
|
|
163
163
|
#else
|
|
164
164
|
- (RNGestureHandlerEventExtraData *)eventExtraData:(UIPinchGestureRecognizer *)recognizer
|
|
165
165
|
{
|
|
166
|
-
CGPoint
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
accumulatedPoint
|
|
171
|
-
|
|
166
|
+
CGPoint focalPoint;
|
|
167
|
+
NSUInteger numberOfTouches = recognizer.numberOfTouches;
|
|
168
|
+
|
|
169
|
+
if (numberOfTouches > 0) {
|
|
170
|
+
CGPoint accumulatedPoint = CGPointZero;
|
|
171
|
+
|
|
172
|
+
for (int i = 0; i < numberOfTouches; i++) {
|
|
173
|
+
CGPoint location = [recognizer locationOfTouch:i inView:recognizer.view];
|
|
174
|
+
accumulatedPoint.x += location.x;
|
|
175
|
+
accumulatedPoint.y += location.y;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
focalPoint = CGPointMake(accumulatedPoint.x / numberOfTouches, accumulatedPoint.y / numberOfTouches);
|
|
179
|
+
} else {
|
|
180
|
+
// Trackpad pinch gestures may report 0 touches - use the recognizer's location instead
|
|
181
|
+
focalPoint = [recognizer locationInView:recognizer.view];
|
|
172
182
|
}
|
|
173
183
|
|
|
174
|
-
CGPoint focalPoint =
|
|
175
|
-
CGPointMake(accumulatedPoint.x / recognizer.numberOfTouches, accumulatedPoint.y / recognizer.numberOfTouches);
|
|
176
|
-
|
|
177
184
|
return [RNGestureHandlerEventExtraData forPinch:recognizer.scale
|
|
178
185
|
withFocalPoint:focalPoint
|
|
179
186
|
withVelocity:recognizer.velocity
|
|
180
|
-
withNumberOfTouches:
|
|
187
|
+
withNumberOfTouches:numberOfTouches
|
|
181
188
|
withPointerType:_pointerType];
|
|
182
189
|
}
|
|
183
190
|
#endif
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-gesture-handler",
|
|
3
|
-
"version": "2.30.0-nightly-20251217-
|
|
3
|
+
"version": "2.30.0-nightly-20251217-6dddda826",
|
|
4
4
|
"description": "Declarative API exposing native platform touch and gesture system to React Native",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "jest",
|