orientation change resize problem on ios safari

607 views
Skip to first unread message

jrdn

unread,
Apr 3, 2014, 9:36:16 AM4/3/14
to pap...@googlegroups.com
I use a full sized canvas with resize in it's tag.

It works fine, except on iOS safari (I have an iPad to test.) when I change the orientation from landscape to portrait.
Then the width of the canvas is wider than the screen.

If I load the page in portrait, the canvas width is fine.
Chrome on the ipad works fine as well.

I also use:
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"/>

What could I do?

Jürg Lehni

unread,
Apr 4, 2014, 6:13:09 AM4/4/14
to pap...@googlegroups.com
Are you auto-scaling your canvas using the resize feature of paper.js? Or is it a fixed size?

When you change orientation your browser width changes even with the meta tag you specify, so you'll have to handle the resize.

If you use resize, it should handle that for you.

Best,

Jürg

--
You received this message because you are subscribed to the Google Groups "Paper.js" group.
To unsubscribe from this group and stop receiving emails from it, send an email to paperjs+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

jrdn

unread,
Apr 15, 2014, 11:03:42 AM4/15/14
to pap...@googlegroups.com
I'm using the resize feature of paper.js .

Please take a look here: http://inthecenterof.net/index2.html 
The number it shows is the width of the view.

I only have this problem on iOs safari on my ipad:
– If I load the page in portrait it says "768"
– then I rotate it to landscape: "1024"
– rotating back to portrait it suddenly says "896"

what could it be?

best, gerhard
Reply all
Reply to author
Forward
0 new messages