Fix painting glitch in elastic scroll.
This commit is contained in:
parent
763b3a37c3
commit
427fc4c8f7
1 changed files with 15 additions and 0 deletions
|
|
@ -895,10 +895,25 @@ void ElasticScroll::applyScrollTo(int position, bool synthMouseMove) {
|
||||||
}
|
}
|
||||||
const auto weak = Ui::MakeWeak(this);
|
const auto weak = Ui::MakeWeak(this);
|
||||||
_dirtyState = true;
|
_dirtyState = true;
|
||||||
|
const auto was = _widget->geometry();
|
||||||
_widget->move(
|
_widget->move(
|
||||||
_vertical ? _widget->x() : -position,
|
_vertical ? _widget->x() : -position,
|
||||||
_vertical ? -position : _widget->y());
|
_vertical ? -position : _widget->y());
|
||||||
if (weak) {
|
if (weak) {
|
||||||
|
const auto now = _widget->geometry();
|
||||||
|
const auto wasFrom = _vertical ? was.y() : was.x();
|
||||||
|
const auto wasTill = wasFrom
|
||||||
|
+ (_vertical ? was.height() : was.width());
|
||||||
|
const auto nowFrom = _vertical ? now.y() : now.x();
|
||||||
|
const auto nowTill = nowFrom
|
||||||
|
+ (_vertical ? now.height() : now.width());
|
||||||
|
const auto mySize = _vertical ? height() : width();
|
||||||
|
if ((wasFrom > 0 && wasFrom < mySize)
|
||||||
|
|| (wasTill > 0 && wasTill < mySize)
|
||||||
|
|| (nowFrom > 0 && nowFrom < mySize)
|
||||||
|
|| (nowTill > 0 && nowTill < mySize)) {
|
||||||
|
update();
|
||||||
|
}
|
||||||
if (_dirtyState) {
|
if (_dirtyState) {
|
||||||
updateState();
|
updateState();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue