- From: Rik Cabanier <cabanier@gmail.com>
- Date: Thu, 25 Jul 2013 20:29:27 -0700
- To: Glenn Maynard <glenn@zewt.org>
- Cc: whatwg <whatwg@whatwg.org>
On Thu, Jul 25, 2013 at 3:59 PM, Glenn Maynard <glenn@zewt.org> wrote: > On Thu, Jul 25, 2013 at 3:49 PM, Rik Cabanier <cabanier@gmail.com> wrote: > >> You still need the scale though, otherwise the canvas content isn't >> zoomed (which is what the user requested) >> > > (We were talking about device pixel ratios, not zooming--user zooming > scales the backing store, which is what we can't do anything about.) > > I think we're misunderstanding each other, but I'm not sure where. If > you're on a 1.1x device, a 100x100 CSS "pixel" (px) box has 110x100 > physical pixels. To draw cleanly into that box, you create a canvas with a > 110x110 pixel backing store, and display it in the 100x100px region, eg. > > <canvas width=110 height=110 style="width: 100px; height: 100px;"> > > You don't do any scaling within the 2d canvas itself, you just draw to it > like a 110x110-pixel canvas. > We're getting a bit off track here :-) No, you need to scale, otherwise the content of your canvas won't scale up. For instance, if you have a 100x100 device pixel rect, it has to become a 110x110 device pixel rect if you zoom by 10%
Received on Friday, 26 July 2013 03:29:52 UTC