Skip to content

Commit

Permalink
Debug std::isnan assertion violation.
Browse files Browse the repository at this point in the history
  • Loading branch information
john-preston committed Nov 2, 2021
1 parent 402b73f commit 53e39e3
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion ui/effects/ripple_animation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,15 @@ void RippleAnimation::Ripple::paint(QPainter &p, const QPixmap &mask, const QCol
}

if (_cache.isNull() || colorOverride != nullptr) {
auto radius = anim::interpolate(_radiusFrom, _radiusTo, _show.value(1.));
const auto shown = _show.value(1.);
Assert(!std::isnan(shown));
const auto diff = float64(_radiusTo - _radiusFrom);
Assert(!std::isnan(diff));
const auto mult = diff * shown;
Assert(!std::isnan(mult));
const auto interpolated = _radiusFrom + mult;//anim::interpolateF(_radiusFrom, _radiusTo, shown);
Assert(!std::isnan(interpolated));
auto radius = int(base::SafeRound(interpolated));//anim::interpolate(_radiusFrom, _radiusTo, _show.value(1.));
_frame.fill(Qt::transparent);
{
QPainter p(&_frame);
Expand Down

0 comments on commit 53e39e3

Please sign in to comment.