Bug 36659 - Canvas linewidth = 0 Not working correctly
Summary: Canvas linewidth = 0 Not working correctly
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Windows XP
: P3 Normal
Assignee: Nobody
URL: http://tierra.hyds.es/~jordi.castells...
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-26 05:58 PDT by Jordi Castells
Modified: 2010-07-16 02:37 PDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jordi Castells 2010-03-26 05:58:09 PDT
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.
Comment 1 Dirk Schulze 2010-06-06 01:08:18 PDT
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)).
Comment 2 Andreas Kling 2010-07-10 14:54:52 PDT
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.
Comment 3 Jordi Castells 2010-07-16 02:37:45 PDT
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.