W3C home > Mailing lists > Public > whatwg@whatwg.org > July 2013

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

From: Glenn Maynard <glenn@zewt.org>
Date: Thu, 25 Jul 2013 17:59:10 -0500
Message-ID: <CABirCh8N_PaWSUX5kt6aVb41SXAw8eBb3Vr7ZEqPr2sfWo2Big@mail.gmail.com>
To: Rik Cabanier <cabanier@gmail.com>
Cc: whatwg <whatwg@whatwg.org>
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.

Glenn Maynard
Received on Thursday, 25 July 2013 22:59:34 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 17:00:03 UTC