heyman333 / react-animated-numbers

👾 Library showing animation of number changes in react.js
MIT License
247 stars 30 forks source link

clientHeight numeric accuracy is not adequate for ”useNumberHeight“ #17

Closed 7PLonG closed 3 years ago

7PLonG commented 3 years ago

maybe could use getClientRects()

heyman333 commented 3 years ago

@7PLonG Thanks! I Will try!

heyman333 commented 3 years ago

I couldn't see any change? Is there any reason for your suggestion?

스크린샷 2021-09-10 오후 6 20 53

7PLonG commented 3 years ago

screen resolution 1920*1080 & set fontsize use viewport suchas '1.875vw', only win10 display scaling "150%", hiddenNode's height rendered to decimals "27.3333px",then container use clientHeigh take an integer(27px) finally animation shows misalignment。

https://developer.mozilla.org/en-US/docs/Web/API/Element/clientHeight

This property will round the value to an integer. If you need a fractional value, use element.getBoundingClientRect().

heyman333 commented 3 years ago

@7PLonG oh thank you! I will fix it asap

heyman333 commented 3 years ago

@7PLonG Released in v0.6.3! thanks again