2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-09-01 07:05:13 +00:00

Use gsl::finally() instead of base::scope_guard().

This commit is contained in:
John Preston
2017-08-13 19:16:48 +03:00
parent 012d59ab42
commit 17cef93ac0
7 changed files with 8 additions and 35 deletions

View File

@@ -538,12 +538,11 @@ bool Widget::Step::paintAnimated(Painter &p, QRect clip) {
return true;
}
auto guard = base::scope_guard([this, &p] {
if (hasCover()) paintCover(p, 0);
});
auto dt = _a_show.current(getms(), 1.);
if (!_a_show.animating()) {
if (hasCover()) {
paintCover(p, 0);
}
if (_coverAnimation.title) {
showFinished();
}
@@ -561,7 +560,6 @@ bool Widget::Step::paintAnimated(Painter &p, QRect clip) {
auto coverTop = (hasCover() ? anim::interpolate(-st::introCoverHeight, 0, showCoverMethod) : anim::interpolate(0, -st::introCoverHeight, hideCoverMethod));
paintCover(p, coverTop);
guard.dismiss();
auto positionReady = hasCover() ? showCoverMethod : hideCoverMethod;
_coverAnimation.title->paintFrame(p, positionReady, departingAlpha, arrivingAlpha);