Bug 19820 - Description of transformation in drawimage is confusing
Summary: Description of transformation in drawimage is confusing
Alias: None
Product: HTML WG
Classification: Unclassified
Component: HTML Canvas 2D Context (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: Jay Munro
QA Contact: HTML WG Bugzilla archive list
Depends on: 19818
  Show dependency treegraph
Reported: 2012-11-01 15:45 UTC by rcabanie
Modified: 2013-02-01 07:35 UTC (History)
6 users (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description rcabanie 2012-11-01 15:45:39 UTC
See: http://www.w3.org/TR/2dcontext/#drawing-images-to-the-canvas

The text for drawImage currently states:
When drawImage() is invoked, the region of the image specified by the source rectangle must be painted on the region of the canvas specified by the destination rectangle, after applying the current transformation matrix to the points of the destination rectangle.

This is a bit confusing since you don't really apply the transform to the points. Basically, you map the source rect to the destination rect and then transform the destination rectangle.
I believe the spec should also call out that there should be no loss of precision when doing this (i.e. if the destination has half the pixels but scaled by 2, the original pixel should be preserve)
Comment 1 Jay Munro 2012-11-09 22:20:56 UTC
This is an Editor's Response to your comment. If
you are satisfied with this response, please change the state of
this bug to CLOSED. If you have additional information and would
like the Editor to reconsider, please reopen this bug. If you would
like to escalate the issue to the full HTML Working Group, please
add the TrackerRequest keyword to this bug, and suggest title and
text for the Tracker Issue; or you may create a Tracker Issue
yourself, if you are able to do so. For more details, see this


Change Description:

Applying the matrix is not on the points of a rectangle. Also clarified that the original image is not updated.
Comment 2 Edward O'Connor 2012-11-09 23:15:26 UTC
Have you suggested this change to Ian?
Comment 3 Jay Munro 2012-11-13 16:13:40 UTC
No, I thought he was watching our bugs as well. I'd be glad to suggest it. (In reply to comment #2)
> Have you suggested this change to Ian?
Comment 4 Silvia Pfeiffer 2013-02-01 07:35:43 UTC
Note, he made this change: