You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a Skia Canvas that in different instances can render anywhere between 10 and 5000 circles.
Wrapping the canvas I have a GestureHandler that I use for zoom and pan logic on the canvas.
To make the circles look like they're "the same size" no matter the zoom level, I need to transform the circles by the "opposite" of the zoom scale.
Currently what I do is take my "unscaled" radius (so 5), and multiply it by the opposite of the zoom scale.
Now coming from web development it's generally recommended to use transform instead of changing top, left, and width values etc..
Here I followed the docs, but my question is - in cases where performance really matters, would you also strongly recommended to use transform instead of passing a SharedValue to the component's attributes too?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hello, first of all love the library!
I have a Skia Canvas that in different instances can render anywhere between 10 and 5000 circles.
Wrapping the canvas I have a GestureHandler that I use for zoom and pan logic on the canvas.
To make the circles look like they're "the same size" no matter the zoom level, I need to transform the circles by the "opposite" of the zoom scale.
Currently what I do is take my "unscaled" radius (so 5), and multiply it by the opposite of the zoom scale.
And then pass it like this:
Now coming from web development it's generally recommended to use
transform
instead of changingtop
,left
, andwidth
values etc..Here I followed the docs, but my question is - in cases where performance really matters, would you also strongly recommended to use
transform
instead of passing aSharedValue
to the component's attributes too?Beta Was this translation helpful? Give feedback.
All reactions