W3C home > Mailing lists > Public > public-canvas-api@w3.org > July to September 2010

Re: 7-arg drawImage() call

From: Philip Taylor <pjt47@cam.ac.uk>
Date: Sat, 17 Jul 2010 11:51:30 +0100
Message-ID: <4C418B32.9000908@cam.ac.uk>
To: Jatinder Mann <jmann@microsoft.com>
CC: "'public-canvas-api@w3.org' (public-canvas-api@w3.org)" <public-canvas-api@w3.org>
Jatinder Mann wrote:
> The following text from Section 12 Images [1] seems to imply a
> 7-argument drawImage() call:
> 
> "If not specified, the dw and dh arguments must default to the values
> of sw and sh, interpreted such that one CSS pixel in the image is
> treated as one unit in the canvas coordinate space."
> 
> To not specify those two arguments would be to make a function call
> like so: drawImage(image, sx, sy, sw, dx, dy). In the latest version
> of the spec, such a drawImage function call is not specified and
> neither do any of the major browser vendors implement this function.

The normative definition of the overloads 
(http://dev.w3.org/html5/2dcontext/#canvasrenderingcontext2d) is:

   void drawImage(in HTML[...]Element image, in float dx, in float dy, 
in optional float dw, in float dh);

   void drawImage(in HTML[...]Element image, in float sx, in float sy, 
in float sw, in float sh, in float dx, in float dy, in float dw, in 
float dh);

The last two arguments in the first overload are optional, so you can 
call "drawImage(image, dx, dy)". That's the case where dw/dh are not 
specified and default to sw/sh, which that spec sentence is referring 
to. I don't see why it would be interpreted as referring to overloads 
that are never defined and can never be called. Can you suggest specific 
text that would make it clearer?

-- 
Philip Taylor
pjt47@cam.ac.uk
Received on Saturday, 17 July 2010 10:51:59 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:31:50 UTC