use devicePixelRatio to take zoom/hiDPI into account