canvas.drawImage does not flip/mirror image as stated in documentation

RESOLVED DUPLICATE of bug 629875

Status

()

defect
RESOLVED DUPLICATE of bug 629875
6 years ago
5 years ago

People

(Reporter: szdy12, Unassigned)

Tracking

Trunk
x86
Windows XP
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

User Agent: Mozilla/5.0 (Windows NT 5.1; rv:28.0) Gecko/20100101 Firefox/28.0 (Beta/Release)
Build ID: 20140213172947

Steps to reproduce:

Documentation at
https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D#drawImage%28%29
states that "If you specify a negative value [for sw], the image is flipped horizontally when drawn."



Actual results:

An error will be raised: " "Index or size is negative or greater than the allowed amount"


Expected results:

Mirrored/flipped image should be drawn.
Status: UNCONFIRMED → NEW
Component: Untriaged → Canvas: 2D
Ever confirmed: true
Product: Firefox → Core
Version: 28 Branch → Trunk
After reading the specification at
http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-drawimage

- The specification does not say anything about flipping the image. Flipping images this way would be very convenient though.
- However, the specification explicitly allows negative dimensions: "The image data must be processed in the original direction, even if the dimensions given are negative.". Firefox does not support negative dimensions for the destination rectangle either: nothing will be drawn in this case.
- Also, the specification says "When the source rectangle is outside the source image, the source rectangle must be clipped to the source image and the destination rectangle must be clipped in the same proportion.". Currently, Firefox does not support source rectangle clipping, it throws the same error mentioned above ("Index or size is negative or greater than the allowed amount")
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 629875
You need to log in before you can comment on or make changes to this bug.