Bug 36659
Summary: | Canvas linewidth = 0 Not working correctly | ||
---|---|---|---|
Product: | WebKit | Reporter: | Jordi Castells <jordi.kstells> |
Component: | Layout and Rendering | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED INVALID | ||
Severity: | Normal | CC: | ap, bdakin, kling, krit, oliver |
Priority: | P3 | ||
Version: | 528+ (Nightly build) | ||
Hardware: | PC | ||
OS: | Windows XP | ||
URL: | http://tierra.hyds.es/~jordi.castells/canvas_test.php |
Jordi Castells
When canvas linewidth value is set to 0 and a path drawn, webkit draws a line when it should not (because linewidth=0 implies no line at all).
Check the given URL for a clear example showing linewidth from 0 to 10.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Dirk Schulze
This is caused by the early return in http://trac.webkit.org/browser/trunk/WebCore/html/canvas/CanvasRenderingContext2D.cpp#L218
Are there any reasons for this? We have checks in strokeRect and other methods that return on strokeWidth of 0. I think we can change if (!(isfinite(width) && width > 0)) to if (!isfinite(width) || width < 0)).
Andreas Kling
http://www.whatwg.org/specs/web-apps/current-work/#dom-context-2d-linewidth
"The lineWidth attribute gives the width of lines, in coordinate space units. On getting, it must return the current value. On setting, zero, negative, infinite, and NaN values must be ignored, leaving the value unchanged; other values must change the current value to the new value."
The initial value of lineWidth is 1.0, thus it can never be 0.
Jordi Castells
I get your point.
I'm setting bug status to resolved->Invalid.
(In reply to comment #2)
> http://www.whatwg.org/specs/web-apps/current-work/#dom-context-2d-linewidth
>
> "The lineWidth attribute gives the width of lines, in coordinate space units. On getting, it must return the current value. On setting, zero, negative, infinite, and NaN values must be ignored, leaving the value unchanged; other values must change the current value to the new value."
>
> The initial value of lineWidth is 1.0, thus it can never be 0.