Closed
Bug 329598
Opened 20 years ago
Closed 18 years ago
createPattern bugs
Categories
(Core :: Graphics: Canvas2D, defect)
Tracking
()
RESOLVED
WORKSFORME
People
(Reporter: annevk, Unassigned)
References
Details
(Keywords: testcase)
Attachments
(5 files)
Feel free to split this bug (and the four testcases I'm about to attach) into different bugs. This is more or less a follow-up to bug 308929. Here are the problems:
1. The pattern is drawn in the wrong location.
2. repeat-x and repeat-y are not supported.
| Reporter | ||
Comment 1•20 years ago
|
||
| Reporter | ||
Comment 2•20 years ago
|
||
| Reporter | ||
Comment 3•20 years ago
|
||
| Reporter | ||
Comment 4•20 years ago
|
||
| Reporter | ||
Comment 5•20 years ago
|
||
(In reply to comment #3)
> Created an attachment (id=214293) [edit]
> testcase #2
(This is the single no-repeat case)
Why do you say that the circle should be centered in the black bordered square? You're filling a rectangle from 0,0 to 150,150, with a 50x50 pattern image. It's in the right place..
repeat-x/repeat-y not being supported is known; I need to write code to emulate it using clipping, but it's a pain.
Now, the circle is ending up corrupted in the tiling for some reason; I'll look into that.
> Now, the circle is ending up corrupted in the tiling for some reason; I'll look
> into that.
Blah, I know why that's happening; the handling of 1-bit images is horked (bits are packed backwards). I'll fix.
| Reporter | ||
Comment 8•20 years ago
|
||
(In reply to comment #6)
> Why do you say that the circle should be centered in the black bordered
> square? You're filling a rectangle from 0,0 to 150,150, with a 50x50 pattern
> image. It's in the right place..
The specification says: "Patterns are painted so that the first image is centered in the middle of the coordinate space, [...]"
This seems to imply that the image is not in the right place.
(In reply to comment #8)
> (In reply to comment #6)
> > Why do you say that the circle should be centered in the black bordered
> > square? You're filling a rectangle from 0,0 to 150,150, with a 50x50 pattern
> > image. It's in the right place..
>
> The specification says: "Patterns are painted so that the first image is
> centered in the middle of the coordinate space, [...]"
>
> This seems to imply that the image is not in the right place.
Ugh.. the spec is bogus in that case. It should specify that pattern tiling always starts at the origin specified by the current transformation matrix. (Because that's the only thing that makes sense, and it's also what both us and safari have implemented -- safari's pattern tiling is broken for everything but the "repeat" case, though, in 10.4)
| Reporter | ||
Comment 10•20 years ago
|
||
Fine by me. I'm just testing the spec ;-)
Comment 11•20 years ago
|
||
vlad: When the spec is bogus, please let me know. Commenting in a bug report is not likely to get my attention (I only noticed it by luck this time).
Anyway, I'll take a look at this...
Comment 12•20 years ago
|
||
Ok, spec updated.
(In reply to comment #11)
> vlad: When the spec is bogus, please let me know. Commenting in a bug report is
> not likely to get my attention (I only noticed it by luck this time).
>
> Anyway, I'll take a look at this...
Yeah, I planned to verify Safari first (by looking at the source, at least) before letting you know :)
Comment 14•20 years ago
|
||
Ah, ok. Thanks! :-) Let me know if you find the Safari source disagrees with the new spec wording.
| Reporter | ||
Comment 15•20 years ago
|
||
After thinking about it, does the new spec text still make sense for strokes?
Yes, a stroke is the same thing as a fill -- except that the original path is transformed into a path to be filled according to the stroke parameters (line width, line caps/joins).
| Reporter | ||
Comment 17•20 years ago
|
||
Well for paths it might make more sense to align in the middle, but I don't really care. These testcases are now hosted here:
http://testsuite.org/html/elements/canvas/getContext/2d/createPattern/
If there are no more bugs I guess this can be resolved.
Comment 18•19 years ago
|
||
MORE TESTCASES
http://www.hixie.ch/tests/adhoc/html/canvas/021.html
http://www.hixie.ch/tests/adhoc/html/canvas/022.html
http://www.hixie.ch/tests/adhoc/html/canvas/023.html
http://www.hixie.ch/tests/adhoc/html/canvas/024.html
http://www.hixie.ch/tests/adhoc/html/canvas/025.html
http://www.hixie.ch/tests/adhoc/html/canvas/026.html
http://www.hixie.ch/tests/adhoc/html/canvas/027.html
http://www.hixie.ch/tests/adhoc/html/canvas/028.html
These test placement. I didn't see any errors except bug 380207.
Comment 19•18 years ago
|
||
There appear to be no bugs in this except repeat-x and repeat-y not being supported properly. Resolving WFM.
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → WORKSFORME
You need to log in
before you can comment on or make changes to this bug.
Description
•