metafizzy / packery

:bento: Gapless, draggable grid layouts
https://packery.metafizzy.co
4.14k stars 315 forks source link

🐛 Fix stamps on high dpi screens #537

Open arcs- opened 4 years ago

arcs- commented 4 years ago

The this._getElementOffset( elem ) in _manageStamp( elem ) returns the positions with decimal places, this results in the misalignment of the the items. E.g., in a gutter of 50px, a stamp with size 50px and position 0.0034 will use its cell and the following one. (I experienced this mostly on high DPI screens). Rounding the numbers will correct the issue, the "item"'s position is already rounded, just the stamps are not.