strues / retinajs

JavaScript, SCSS, Sass, Less, and Stylus helpers for rendering high-resolution image variants

Home Page:http://retinajs.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

devicePixelRatio rounding

jaykay-design opened this issue · comments

I got some strange device pixel ratios like 2.0000000298023224

I fixed it with changing line 24 to:

var environment = hasWindow ? Math.round(window.devicePixelRatio * 10) / 10 || 1 : 1;