rive-react
rive-react copied to clipboard
use getBoundingClientRect to account for decimals in container size
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