Opened 10 years ago
Closed 10 years ago
#12226 closed defect (fixed)
[patch][CCLA] canvas renderer does not take into account the x/y/width/height attributes of a pattern fill style.
Reported by: | Patrick Ruzand | Owned by: | Eugene Lazutkin |
---|---|---|---|
Priority: | high | Milestone: | 1.6 |
Component: | DojoX GFX | Version: | 1.6.0b1 |
Keywords: | canvas pattern gfx | Cc: | |
Blocked By: | Blocking: |
Description
The canvas renderer does not taken into account the x/y/width/height attributes of a pattern fill style.
In the current implementation, the pattern image is created via the new Image(w,h) ctor, specifying the fillstyle with/height. However, the canvas spec. tells that the original image data must be used when creating the pattern, therefore the image scaling done in the ctor is not taken into account by the context2d (as we can see by running the dojox/gfx/tests/test_pattern.html sample with the canvas renderer enabled).
Proposed fix: the image scaling needs to be done in an temporary canvas via a call to drawImage(), and then pass this temp. canvas element to the ctx.createPattern() method. See patch attached.
Patches attached (canvas.js, test_pattern.html) submitted by Patrick Ruzand, IBM (CCLA)
Attachments (2)
Change History (4)
Changed 10 years ago by
Attachment: | test_pattern.patch added |
---|
Changed 10 years ago by
Attachment: | canvas_patternbug.patch added |
---|
fix pattern scaling and offset support
comment:1 Changed 10 years ago by
Milestone: | tbd → 1.6 |
---|---|
Status: | new → assigned |
modify test to add x/y offset and aspect ratio testing