Skip to content

Commit b11757f

Browse files
author
Andrzej Antoni Kwaśniewski
committed
temporary commit
1 parent ed3b7a4 commit b11757f

2 files changed

Lines changed: 6 additions & 16 deletions

File tree

packages/react-native-gesture-handler/shared/shadowNodes/react/renderer/components/rngesturehandler_codegen/RNGestureHandlerDetectorShadowNode.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,6 @@ void RNGestureHandlerDetectorShadowNode::layout(LayoutContext layoutContext) {
3838
// TODO: consider allowing more than one child and doing bounding box
3939
react_native_assert(getChildren().size() == 1);
4040

41-
if (!this->yogaNode_.getHasNewLayout()) {
42-
return;
43-
}
44-
4541
auto child = std::static_pointer_cast<const YogaLayoutableShadowNode>(
4642
getChildren()[0]);
4743

@@ -51,6 +47,7 @@ void RNGestureHandlerDetectorShadowNode::layout(LayoutContext layoutContext) {
5147
// TODO: figure out the correct way to setup metrics between detector and
5248
// the child
5349
auto metrics = child->getLayoutMetrics();
50+
metrics.frame = child->getLayoutMetrics().frame;
5451
setLayoutMetrics(metrics);
5552

5653
auto childmetrics = child->getLayoutMetrics();

packages/react-native-gesture-handler/src/v3/components/Pressable/utils.ts

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Insets, Platform } from 'react-native';
1+
import { Insets } from 'react-native';
22
import {
33
InnerPressableEvent,
44
PressableEvent,
@@ -62,17 +62,10 @@ const isTouchWithinInset = (
6262
inset: Insets,
6363
touch?: InnerPressableEvent
6464
) =>
65-
Platform.OS === 'ios'
66-
? (touch?.locationX ?? 0) <
67-
(inset.right ?? 0) + dimensions.width + dimensions.x &&
68-
(touch?.locationY ?? 0) <
69-
(inset.bottom ?? 0) + dimensions.height + dimensions.y &&
70-
(touch?.locationX ?? 0) > -(inset.left ?? 0) + dimensions.x &&
71-
(touch?.locationY ?? 0) > -(inset.top ?? 0) + dimensions.y
72-
: (touch?.locationX ?? 0) < (inset.right ?? 0) + dimensions.width &&
73-
(touch?.locationY ?? 0) < (inset.bottom ?? 0) + dimensions.height &&
74-
(touch?.locationX ?? 0) > -(inset.left ?? 0) &&
75-
(touch?.locationY ?? 0) > -(inset.top ?? 0);
65+
(touch?.locationX ?? 0) < (inset.right ?? 0) + dimensions.width &&
66+
(touch?.locationY ?? 0) < (inset.bottom ?? 0) + dimensions.height &&
67+
(touch?.locationX ?? 0) > -(inset.left ?? 0) &&
68+
(touch?.locationY ?? 0) > -(inset.top ?? 0);
7669

7770
const gestureToPressableEvent = (
7871
event: HoverGestureEvent | LongPressGestureEvent

0 commit comments

Comments
 (0)