Skip to content

Commit

Permalink
Touch up negative segment start and end values
Browse files Browse the repository at this point in the history
NaN values are also zeroed.
  • Loading branch information
mymedia2 committed Mar 5, 2022
1 parent a81585d commit a3984b6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/lottie/lottiemodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -1055,17 +1055,17 @@ class Trim : public Object {
private:
Segment noloop(float start, float end) const
{
assert(start >= 0);
assert(end >= 0);
if (!(start >= 0)) start = 0;
if (!(end >= 0)) end = 0;
Segment s;
s.start = std::min(start, end);
s.end = std::max(start, end);
return s;
}
Segment loop(float start, float end) const
{
assert(start >= 0);
assert(end >= 0);
if (!(start >= 0)) start = 0;
if (!(end >= 0)) end = 0;
Segment s;
s.start = std::max(start, end);
s.end = std::min(start, end);
Expand Down

0 comments on commit a3984b6

Please sign in to comment.