W3C home > Mailing lists > Public > whatwg@whatwg.org > February 2010

[whatwg] Canvas size and double buffering.

From: Brian Campbell <lambda@continuation.org>
Date: Thu, 4 Feb 2010 09:25:52 -0500
Message-ID: <AB852B08-8D34-42FF-BAF3-2CC45C01359B@continuation.org>
On Feb 4, 2010, at 1:55 AM, Robert O'Callahan wrote:

> On Thu, Feb 4, 2010 at 6:50 PM, Brian Campbell <lambda at continuation.org> wrote:
> I think the most reasonable approach would be to say that the getBoundingClientRect().width or height is rounded to the nearest pixel. Boxes are displayed rounded to the nearest pixel, with no fractional pixels being drawn, right?
> 
> No.

In what cases are fractional pixels drawn? I see fractional widths being returned here, but it seems to be drawing rounded to the nearest pixel:

http://ephemera.continuation.org/percentage-width.html

> Why would they report a width or height that is different than how they are displayed? All browsers that I've tested (the ones listed above, so not IE) report integral values for getBoundingClientRect().width and height (or for left and right in the case of Opera, which doesn't support width and height).
>  
> Firefox often returns non-integral values for getBoundingClientRect().width or height.

Sorry, I meant to write "but Firefox", but somehow missed that. Safari, Chrome, and Opera all return values rounded to the nearest pixel.

-- Brian
Received on Thursday, 4 February 2010 06:25:52 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:20 UTC