rive-app / rive-react

React runtime for Rive
https://rive-app.github.io/rive-react
MIT License
755 stars 27 forks source link

use getBoundingClientRect to account for decimals in container size #260

Open bodymovin opened 1 month ago

bodymovin commented 1 month ago

clientWidth and clientHeight return element size without the decimals. getBoundingClientRect instead returns a more precise size that we can use to make sure the canvas is not slightly smaller than the container