Closed
Bug 1486318
Opened 6 years ago
Closed 6 years ago
Transforms set in CanvasPattern.setTransform are not applied for fillText calls
Categories
(Core :: Graphics: Canvas2D, defect, P3)
Core
Graphics: Canvas2D
Tracking
()
RESOLVED
FIXED
mozilla63
Tracking | Status | |
---|---|---|
firefox63 | --- | fixed |
People
(Reporter: flaki, Assigned: aosmond)
References
()
Details
(Whiteboard: [gfx-noted])
Attachments
(2 files)
(deleted),
image/png
|
Details | |
(deleted),
patch
|
lsalzman
:
review+
|
Details | Diff | Splinter Review |
When using setTransform on a CanvasPattern object to transform the pattern before applying it in fillStyle, the specified transformations are only rendered when using e.g. fillRect, but not when using fillText.
To reproduce:
1. Load MDN page for "<CanvasPattern>.setTransform()", click "Open in Codepen" below the example code:
https://developer.mozilla.org/en-US/docs/Web/API/CanvasPattern/setTransform
2. In the textarea replace line from original example:
ctx.fillRect(0, 0, 400, 400);
3. ...with the code below:
ctx.font = "bold 300px arial";
ctx.fillText("test", 0, 200 );
Expected result: rotated/scaled pattern is used to fill the text outlines
Actual result: the pattern used to fill the text outlines is missing all transformations applied in the setTransform() call
Problem is also seen in original post (https://codepen.io/xem/pen/aaNzQe), cross-referencing this page in latest Firefox vs eg. Chrome shows that Chrome will apply the rotation for the pattern (horizontal dark stripes on the text), while Firefox won't (vertical stripes).
Assignee | ||
Updated•6 years ago
|
Assignee: nobody → aosmond
Status: NEW → ASSIGNED
Priority: -- → P3
Whiteboard: [gfx-noted]
Assignee | ||
Comment 1•6 years ago
|
||
Looks like we just forgot to include the transform in the pattern on the text path to me.
try: https://treeherder.mozilla.org/#/jobs?repo=try&revision=962d3d29da14f1924461fdcb7ddd80f93fd896cd
Attachment #9005149 -
Flags: review?(lsalzman)
Updated•6 years ago
|
Attachment #9005149 -
Flags: review?(lsalzman) → review+
Pushed by aosmond@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/ac1682b691d8
Actually apply transform from canvas pattern when drawing text to a canvas. r=lsalzman
Comment 3•6 years ago
|
||
bugherder |
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla63
You need to log in
before you can comment on or make changes to this bug.
Description
•