Skip to content

Commit

Permalink
Clamping color stops.
Browse files Browse the repository at this point in the history
Addresses issue #6034 where color stops can sometimes be just outside the 0-1 range.

Diffs=
6ee7cea9e Clamping color stops. (#6052)

Co-authored-by: Luigi Rosso <luigi-rosso@users.noreply.github.com>
  • Loading branch information
luigi-rosso and luigi-rosso committed Sep 29, 2023
1 parent 0f69c2d commit ef7dd36
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .rive_head
Original file line number Diff line number Diff line change
@@ -1 +1 @@
bb00ec119d2ced89395c70e718419aa970b312d8
6ee7cea9edb3efb81318bc5a8a1db2c6a28c011a
2 changes: 1 addition & 1 deletion src/shapes/paint/linear_gradient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ void LinearGradient::applyTo(RenderPaint* renderPaint, float opacityModifier) co
for (size_t i = 0; i < count; ++i)
{
colors[i] = colorModulateOpacity(m_Stops[i]->colorValue(), ro);
stops[i] = m_Stops[i]->position();
stops[i] = std::max(0.0f, std::min(m_Stops[i]->position(), 1.0f));
}

makeGradient(renderPaint, start, end, colors, stops, count);
Expand Down

0 comments on commit ef7dd36

Please sign in to comment.