Transformation `Scale` not working
See original GitHub issueI’d like to make a zoomable chart, with react-native-gesture-handler
.
But Chart Group doesn’t update when scale value was updated.
persudo code
function Zoomable() {
const scale = useValue(1); // it works if I changed initial value.
const pinchGesture = Gesture.Pinch()
.onStart((e) => {
"worklet";
scale.current = e.scale;
})
.onUpdate((e) => {
"worklet";
scale.current = e.scale;
});
return (
<GestureDetector gesture={pinchGesture}>
<Canvas>
<Group transform={[{scale: scale.current}]}>
<Chart />
</Group>
</Canvas>
</GestureDetector>
)
}
dependencies
{
"@shopify/react-native-skia": "^0.1.133",
"react": "18.0.0",
"react-native": "0.69.0",
"react-native-gesture-handler": "^2.5.0",
"react-native-reanimated": "^2.8.0"
}
Issue Analytics
- State:
- Created a year ago
- Comments:11 (3 by maintainers)
Top Results From Across the Web
css - Transform scale property not working in Chrome & Safari
I am having another problem with this code. While this solution works in chrome, it still has the same effect in Safari and...
Read more >Transform Scale Not Working - Adobe Support Community
Solved: When I use transform scale to change the size of an image, it defaults to 'maintain aspect ratio'. However, if I turn...
Read more >[SOLVED] Scale Transformation Not Working - Forum | Webflow
I am facing a little yet mysterious issue with my Webflow Website. Indeed, the template I am using has a bunch of boxes...
Read more >Css transform:scale(); not working..(solved) - Sololearn
I am able zoom (transform scale for earth) but not able zoom(transform scale for rocket) why anyone define it. htmlcsswebnotworkingtransform:scale();. 9th Sep ...
Read more >scale() - CSS: Cascading Style Sheets - MDN Web Docs
The scale() CSS function defines a transformation that resizes an element on the ... Report problems with this compatibility data on GitHub ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hello there 🙋🏼♂️
We have a very fun pinch to zoom (and rotate/pan) example with gesture handler and reanimated at https://github.com/wcandillon/can-it-be-done-in-react-native/tree/master/bonuses/sticker-app/src This seems to fit your use case perfectly.
If you think that there is a bug with the implementation, please feel free to reopen this issue. If you have any questions on such examples, we will have video tutorial soon available on youtube on this exact topic and you can ask us in the discussion section at https://github.com/Shopify/react-native-skia/discussions
Yes that makes a lot of sense actually, thank you for pointing that out.