mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-15 13:47:05 +02:00
Slightly improved fade effect in price categories from star gift box.
This commit is contained in:
parent
706f142a98
commit
a7ae7a8cda
1 changed files with 8 additions and 0 deletions
|
@ -973,7 +973,15 @@ struct GiftPriceTabs {
|
|||
const auto w = icon.fadeRight.width();
|
||||
const auto &c = st::boxDividerBg->c;
|
||||
const auto r = QRect(0, 0, w, raw->height());
|
||||
const auto s = std::abs(float64(shift.x()));
|
||||
constexpr auto kF = 0.5;
|
||||
const auto opacityRight = (state->scrollMax - s)
|
||||
/ (icon.fadeRight.width() * kF);
|
||||
p.setOpacity(std::clamp(std::abs(opacityRight), 0., 1.));
|
||||
icon.fadeRight.fill(p, r.translated(raw->width() - w, 0), c);
|
||||
|
||||
const auto opacityLeft = s / (icon.fadeLeft.width() * kF);
|
||||
p.setOpacity(std::clamp(std::abs(opacityLeft), 0., 1.));
|
||||
icon.fadeLeft.fill(p, r, c);
|
||||
}
|
||||
}, raw->lifetime());
|
||||
|
|
Loading…
Add table
Reference in a new issue