Skip to content

Commit

Permalink
Make ImageCropView animated style function a worklet
Browse files Browse the repository at this point in the history
  • Loading branch information
QichenZhu committed Jul 15, 2024
1 parent d0ed04e commit 39404fe
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/components/AvatarCropModal/ImageCropView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ function ImageCropView({imageUri = '', containerSize = 0, panGesture = Gesture.P

// A reanimated memoized style, which updates when the image's size or scale changes.
const imageStyle = useAnimatedStyle(() => {
'worklet';

const height = originalImageHeight.value;
const width = originalImageWidth.value;
const aspectRatio = height > width ? height / width : width / height;
Expand Down

0 comments on commit 39404fe

Please sign in to comment.