Closed
Bug 974367
Opened 12 years ago
Closed 12 years ago
canvas.drawImage does not flip/mirror image as stated in documentation
Categories
(Core :: Graphics: Canvas2D, defect)
Tracking
()
RESOLVED
DUPLICATE
of bug 629875
People
(Reporter: szdy12, Unassigned)
Details
Attachments
(1 file)
|
750 bytes,
text/html
|
Details |
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.
Updated•12 years ago
|
Status: UNCONFIRMED → NEW
Component: Untriaged → Canvas: 2D
Ever confirmed: true
Product: Firefox → Core
Version: 28 Branch → Trunk
| Reporter | ||
Comment 1•12 years ago
|
||
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")
Updated•12 years ago
|
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → DUPLICATE
You need to log in
before you can comment on or make changes to this bug.
Description
•