mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 22:46:10 +00:00
Replaced snap util function with std::clamp.
This commit is contained in:
@@ -153,8 +153,9 @@ void TabbedSelector::SlideAnimation::paintFrame(QPainter &p, float64 dt, float64
|
||||
auto rightAlpha = (leftToRight ? departingAlpha : arrivingAlpha);
|
||||
|
||||
// _innerLeft ..(left).. leftTo ..(both).. bothTo ..(none).. noneTo ..(right).. _innerRight
|
||||
auto leftTo = _innerLeft + snap(_innerWidth + leftCoord, 0, _innerWidth);
|
||||
auto rightFrom = _innerLeft + snap(rightCoord, 0, _innerWidth);
|
||||
auto leftTo = _innerLeft
|
||||
+ std::clamp(_innerWidth + leftCoord, 0, _innerWidth);
|
||||
auto rightFrom = _innerLeft + std::clamp(rightCoord, 0, _innerWidth);
|
||||
auto painterRightFrom = rightFrom / cIntRetinaFactor();
|
||||
if (opacity < 1.) {
|
||||
_frame.fill(Qt::transparent);
|
||||
|
Reference in New Issue
Block a user