[whatwg] Blurry lines in 2D Canvas (and SVG)

Rik Cabanier cabanier at gmail.com
Thu Jul 25 20:29:27 PDT 2013


On Thu, Jul 25, 2013 at 3:59 PM, Glenn Maynard <glenn at zewt.org> wrote:

> On Thu, Jul 25, 2013 at 3:49 PM, Rik Cabanier <cabanier at 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%



More information about the whatwg mailing list