Fix disabled animations dialogs repaint.

This commit is contained in:
John Preston 2018-09-21 10:12:53 +03:00
parent e451dec70c
commit d601b60903
2 changed files with 9 additions and 4 deletions

View file

@ -659,7 +659,9 @@ void StickersBox::Inner::setInnerFocus() {
void StickersBox::Inner::paintEvent(QPaintEvent *e) {
Painter p(this);
_a_shifting.step();
if (_a_shifting.animating()) {
_a_shifting.step();
}
auto clip = e->rect();
auto ms = getms();

View file

@ -219,7 +219,9 @@ void DialogsInner::paintRegion(Painter &p, const QRegion &region, bool paintingO
auto fullWidth = getFullWidth();
auto ms = getms();
if (_state == State::Default) {
_a_pinnedShifting.step(ms, false);
if (_a_pinnedShifting.animating()) {
_a_pinnedShifting.step(ms, false);
}
auto rows = shownDialogs();
auto dialogsClip = r;
@ -1006,15 +1008,16 @@ bool DialogsInner::updateReorderPinned(QPoint localPosition) {
void DialogsInner::step_pinnedShifting(TimeMs ms, bool timer) {
if (anim::Disabled()) {
ms += st::stickersRowDuration;
update();
}
auto wasAnimating = false;
auto animating = false;
auto updateMin = -1;
auto updateMax = 0;
for (auto i = 0, l = static_cast<int>(_pinnedRows.size()); i != l; ++i) {
auto start = _pinnedRows[i].animStartTime;
if (start) {
wasAnimating = true;
if (updateMin < 0) updateMin = i;
updateMax = i;
if (start + st::stickersRowDuration > ms && ms >= start) {
@ -1026,7 +1029,7 @@ void DialogsInner::step_pinnedShifting(TimeMs ms, bool timer) {
}
}
}
if (timer) {
if (timer || (wasAnimating && !animating)) {
updateReorderIndexGetCount();
if (_draggingIndex >= 0) {
if (updateMin < 0 || updateMin > _draggingIndex) {