[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Public WebGL] How to unambiguously set canvas pixel size to be pixel-perfect?



On 11/06/2014 23:01, Boris Zbarsky wrote:
Browsers have two distinct zoom modes in the wild:

1)  The mobile browser zoom-and-pan mode (called "pinch zoom" in the cssom-view spec): zooming doesn't change layout, and simply performs a draw-time upscale or something close to it (font rasterization here is complicated).  The size of the viewport (e.g. as measured by window.innerWidth) does not actually change in this mode.  Instead, the page spills out of the viewport if you zoom in and you can pan around it.

2)  The desktop browser page zoom mode (called "page zoom" in the spec): zooming changes the size of a CSS pixel as measured in device pixels (and hence the size of the viewport) then redoes the page layout using the new viewport size.  Effectively, this corresponds more or less (again, with some font rasterization complications) to resizing the window and then doing a paint-time upscale back to the original size. This can change where linebreaks happen and whatnot.  Typically the resulting layout will not spill out of the viewport horizontally.

In Firefox Mobile text is usually re-flowed on pinch zoom. Sometimes the text layout does spill out of the screen but adjusting the pinch zoom a bit remedies that. This is an observation as an end-user. I have read neither the spec's around this nor source code.

Regards

    -Mark

--
注意:この電子メールには、株式会社エイチアイの機密情報が含まれている場合が有ります。正式なメール受信者では無い場合はメール複製、 再配信または情報の使用を固く禁じております。エラー、手違いでこのメールを受け取られましたら削除を行い配信者にご連絡をお願いいたし ます.

NOTE: This electronic mail message may contain confidential and privileged information from HI Corporation. If you are not the intended recipient, any disclosure, photocopying, distribution or use of the contents of the received information is prohibited. If you have received this e-mail in error, please notify the sender immediately and permanently delete this message and all related copies.