Cant distinguish retina "window.devicePixelRatio = 2" from 200% scale in nonretina

15 views
Skip to first unread message

Sergei Z

unread,
Dec 14, 2016, 5:06:55 AM12/14/16
to Chromium HTML5
Hi. 

I used to program in Adobe Flash but now I moved to HTML5. I want to implement "flash.display.Stage.scaleMode = StageScaleMode.NO_SCALE" mode in HTML5 (user changes the page scale but objects remain the same). 

The problem is I can't determine real device pixel ratio on iMac with retina screen. 

There is no differense in "200% browser scale using nonretina" and "100% browser scale using retina screen", but on retina renders canvas with "window.devicePixelRatio" scale and I cant define if this scale actually applied to the page. 
So images on my canvas are twice smaller because I count "window.devicePixelRatio = 2" as scale. 

Can you offer a good solution to solve the problem or give developers a property to access system(physical) dpi like ms browsers do? 

Thanks in advance.
Reply all
Reply to author
Forward
0 new messages