Sie sind nicht angemeldet.

1

Dienstag, 13. Januar 2015, 20:07

Getting double width on mobile devices?

Dear Klaus,

we've encountered a problem where on mobile devices for some reason the stagewidth and the area.pixelwidth values return double the size they should. We have this code in the embedding html, which is from the website anyway:

Quellcode

1
<meta name="viewport" content="target-densitydpi=device-dpi, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />


Not sure if that has anything to do with this issue. I first thought it might be an error of Chrome's device emulator, but then I tested it on an actual smartphone, and got the same results. Both the above krpano variables return 720, while (if testing in Chrome)

Quellcode

1
jQuery(window).width()


returns 360, which is the correct value. Btw, I have a plugin with align set to bottom, and it's centering as it should. The pano view itself also looks ok.

Do you know what might be causing this?

2

Dienstag, 13. Januar 2015, 20:41

Hi,

that's correct this way - the default stagescale is 0.5 on mobile devices.

See here for more information and for how to set it to 1.0 for mobile devices:
http://krpano.com/docu/actions/#stagescale

And here an interactive example that helps understanding:
http://krpano.com/examples/118/examples/…scale-test.html

Best regards,
Klaus

3

Dienstag, 13. Januar 2015, 22:57

Many thanks. I wasn't aware of this :)