2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-09-06 17:45:11 +00:00

Clip intro animation by Next button.

This commit is contained in:
John Preston
2019-11-29 16:42:42 +03:00
parent 66961dce83
commit 524d64a462
3 changed files with 13 additions and 0 deletions

View File

@@ -233,6 +233,9 @@ bool Step::paintAnimated(Painter &p, QRect clip) {
}
return false;
}
if (!_coverAnimation.clipping.isEmpty()) {
p.setClipRect(_coverAnimation.clipping);
}
auto progress = (hasCover() ? anim::easeOutCirc(1., dt) : anim::linear(1., dt));
auto arrivingAlpha = progress;
@@ -451,6 +454,10 @@ void Step::showAnimated(Direction direction) {
}
}
void Step::setShowAnimationClipping(QRect clipping) {
_coverAnimation.clipping = clipping;
}
void Step::setGoCallback(Fn<void(Step *step, Direction direction)> callback) {
_goCallback = std::move(callback);
}