WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED INVALID
36659
Canvas linewidth = 0 Not working correctly
https://bugs.webkit.org/show_bug.cgi?id=36659
Summary
Canvas linewidth = 0 Not working correctly
Jordi Castells
Reported
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.
Attachments
Add attachment
proposed patch, testcase, etc.
Dirk Schulze
Comment 1
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)).
Andreas Kling
Comment 2
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.
Jordi Castells
Comment 3
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.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug