Fixed reversed animations in mute button.
This commit is contained in:
parent
c4df097339
commit
4761b307b4
1 changed files with 4 additions and 2 deletions
|
|
@ -321,7 +321,9 @@ void CallMuteButton::init() {
|
||||||
blobsInner.center(),
|
blobsInner.center(),
|
||||||
_blobs->width() / 2);
|
_blobs->width() / 2);
|
||||||
|
|
||||||
const auto from = 0.;
|
const auto from = _switchAnimation.animating()
|
||||||
|
? (1. - _switchAnimation.value(0.))
|
||||||
|
: 0.;
|
||||||
const auto to = 1.;
|
const auto to = 1.;
|
||||||
|
|
||||||
auto callback = [=](float64 value) {
|
auto callback = [=](float64 value) {
|
||||||
|
|
@ -348,7 +350,7 @@ void CallMuteButton::init() {
|
||||||
};
|
};
|
||||||
|
|
||||||
_switchAnimation.stop();
|
_switchAnimation.stop();
|
||||||
const auto duration = kSwitchStateDuration;
|
const auto duration = (1. - from) * kSwitchStateDuration;
|
||||||
_switchAnimation.start(std::move(callback), from, to, duration);
|
_switchAnimation.start(std::move(callback), from, to, duration);
|
||||||
}, lifetime());
|
}, lifetime());
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue