diff --git a/Telegram/SourceFiles/ui/effects/premium_graphics.cpp b/Telegram/SourceFiles/ui/effects/premium_graphics.cpp index f36e2472e..fb35336b3 100644 --- a/Telegram/SourceFiles/ui/effects/premium_graphics.cpp +++ b/Telegram/SourceFiles/ui/effects/premium_graphics.cpp @@ -715,7 +715,9 @@ QLinearGradient ComputeGradient( anim::gradient_color_at(fullGradient, left / fullFinal)); gradient.setColorAt( 1., - anim::gradient_color_at(fullGradient, (left + width) / fullFinal)); + anim::gradient_color_at( + fullGradient, + std::min(1., (left + width) / fullFinal))); return gradient; }