tommoor / tinycon

A small library for manipulating the favicon, in particular adding alert bubbles and changing images.
MIT License
5.12k stars 278 forks source link

Relying on window.devicePixelRatio causing issues when browser is zoomed #67

Open cfx1 opened 9 years ago

cfx1 commented 9 years ago

Tested on Firefox 38 and Chrome 42.0.2311.152 with Tinycon 0.6.3

If the page utilizing Tinycon is zoomed in (eg. Ctrl +), Tinycon's use of window.devicePixelRatio will cause the text to be drawn off-center depending on the level of zoom. Apparently using window.devicePixelRatio is not reliable because it is directly affected by the zoom level of the browser, which can change from user to user.

Firefox discussion: https://bugzilla.mozilla.org/show_bug.cgi?id=809788 Stackoverflow discussion: http://stackoverflow.com/questions/16541676/what-are-best-practices-for-detecting-pixel-ratio-density