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

Glenn Maynard glenn at zewt.org
Thu Jul 25 15:59:10 PDT 2013


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.

-- 
Glenn Maynard



More information about the whatwg mailing list