Skip to content

Commit

Permalink
Merge pull request #56733 from bernhardoj/fix/53471-avatar-doesnt-go-…
Browse files Browse the repository at this point in the history
…back-to-original-pos

Fix avatar doesn't go back to center after zoom
  • Loading branch information
francoisl authored Feb 12, 2025
2 parents 532d95d + 1187b39 commit 07cefb6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/components/MultiGestureCanvas/usePinchGesture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,11 @@ const usePinchGesture = ({
.enabled(pinchEnabled)
// The first argument is not used, but must be defined
.onTouchesDown((_evt, state) => {
// react-compiler optimization unintentionally make all the callbacks run on the JS thread.
// Adding the worklet directive here will make all the callbacks run on UI thread back.

'worklet';

// We don't want to activate pinch gesture when we are swiping in the pager
if (!shouldDisableTransformationGestures.get()) {
return;
Expand Down

0 comments on commit 07cefb6

Please sign in to comment.