Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle gradients with multiple color stops at 0.0 or 1.0 #1189

Merged
merged 1 commit into from May 17, 2017

Commits on May 4, 2017

  1. Handle gradients with multiple color stops at 0.0 or 1.0

    When a clamped gradient has multiple color stops at 0.0, the last one
    will fill GradientData[0]. When a clamped gradient has multiple color
    stops at 1.0, the first one will fill GradientData[N-1]. Both of these
    conditions will cause the area outside of the gradient to not be filled
    with the correct clamped color, which is the first or last gradient
    color stop.
    
    Filling the first or last color entry of GradientData with the first or
    last color stop isn't exactly correct either because the first or last
    color stop entry is only needed in this case for the range outside of
    [0, 1].
    
    This commit changes the GradientData so that the first color entry is
    used for offset < 0, the last color entry is used for offset >= 1, and
    the color entries in between are for the range in between. The first and
    last color entries are then filled with the correct colors for those
    ranges.
    eqrion committed May 4, 2017
You can’t perform that action at this time.