Closed GrigoreAlexandru closed 2 years ago
@GrigoreAlexandru
I'm sorry. However, the browser recognizes it as rounding.
I'm thinking about not using rounding right now.
@GrigoreAlexandru
moveable
0.29.1react-moveable
0.32.1preact-moveable
0.31.1ngx-moveable
0.25.1svelte-moveable
0.19.1lit-moveable
0.6.1vue-moveable
2.0.0-beta.8vue3-moveable
0.4.1moveable's new version is released.
use resizeFormat instead of throttleResize.
throttleResize={0}
resizeFormat={size => ([Math.trunc(size[0]), Math.trunc(size[1])])}
In the storybook, we resize the target to a arbitrary size: lock the aspect ratio, change the width and calculate the next height: With the new 232px width, we should have a height of 182px But what happens is we get a height of 183px. I believe this is because of some rounding somewhere. But 182.xxx px is still 182px on the screen, so there should be no rounding when dealing with width/height and instead discard the decimals with Math.trunc().