Opened 16 years ago
Closed 10 years ago
#2945 closed bug (fixed)
BGradient draws junk when endpoints are not fully defined
Reported by: | sdeken | Owned by: | aldeck |
---|---|---|---|
Priority: | normal | Milestone: | R1 |
Component: | Kits/Interface Kit | Version: | R1/pre-alpha1 |
Keywords: | Cc: | ||
Blocked By: | Blocking: | ||
Platform: | All |
Description
To reproduce: Construct, for example, a radial gradient with two defined endpoints:
BPoint center(50, 50); float radius = 50.0; BGradientRadial g(center, radius); g.AddColor((rgb_color){ 255, 255, 255, 255 }, 0.0); g.AddColor((rgb_color){ 255, 0, 0, 255 }, 10.0); FillEllipse(center, radius, radius, g);
Actual result: Part of the center portion of the ellipse is filled with a transition from white to red, but the remainder is filled with concentric bands of random color.
Expected result: Part of the center portion of the ellipse is filled with a transition from white to red, and the remainder of the ellipse is filled with red.
Change History (5)
comment:1 by , 15 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:2 by , 15 years ago
Status: | assigned → new |
---|
follow-up: 4 comment:3 by , 12 years ago
Owner: | changed from | to
---|---|
Status: | new → in-progress |
comment:4 by , 12 years ago
Replying to aldeck:
Will fix soon. Btw what's the opinion about making the range 0.0f - 1.0f ? it's already a float.
Makes sense to me, at least.
Also, an out of range value (v < 0 or v > 255) crashes the app server. We need some validity checking.
Sounds like it :-)
Spotted the problem while working on a webkit bug. Color stops positions are in the range 0-255. If the first color stop position is > 0, then the begining of the gradient array is left uninitialized. Respectively for the last stop if it's not at 255.
Will fix soon. Btw what's the opinion about making the range 0.0f - 1.0f ? it's already a float.
Also, an out of range value (v < 0 or v > 255) crashes the app server. We need some validity checking.