take pixelRatio into account