Re: [css3-images] `image-resolution: span` and transformations.

On Fri, Jul 26, 2013 at 10:21 AM, Simon Sapin <simon.sapin@exyr.org> wrote:
> Le 26/07/2013 17:56, Tab Atkins Jr. a écrit :
>> I don't think it should.  For one, this would mean that the intrinsic
>> size of an image changes as you transform it, which is clearly not a
>> good result.
>
> Your first point also applies to user zoom, especially with mobile-style
> panning zoom. What does "snap" mean in this context?

No, mobile pinch-zoom is a distinct type of zoom.  We need to
formalize these concepts within CSS, as they're being formalized in
the back-end ad-hocly right now.

The relevant type of zoom is the one that changes the viewport size.
This changes a bunch of the layout, so it's okay for images to have a
different intrinsic size.

>> Plus, for the purpose of drawing into a <canvas>, we're choosing to
>> report the native screen resolution * zoom level, but aren't paying
>> attention to transforms.  This should work similarly.
>
> I don’t understand, can you expand on that? I’m not very familiar with
> canvas, how does it expose the device resolution?

We (Blink/Webkit) currently expose the device pixel ratio via a
.devicePixelRatio somewhere.  We're planning on folding in user zoom
to this factor as well.  You can then use this when constructing a
canvas to get maximally-sharp lines, by setting the desired canvas
size via CSS, then setting the width/height attributes on the <canvas>
element itself to those values * the zoom factor.

~TJ

Received on Friday, 26 July 2013 17:42:37 UTC