Fix incorrect state of ElasticScroll.
This commit is contained in:
parent
079d966e45
commit
ad852f0f4a
1 changed files with 6 additions and 4 deletions
|
|
@ -734,13 +734,13 @@ bool ElasticScroll::eventFilter(QObject *obj, QEvent *e) {
|
||||||
if (obj == _widget.data()) {
|
if (obj == _widget.data()) {
|
||||||
if (filterOutTouchEvent(e)) {
|
if (filterOutTouchEvent(e)) {
|
||||||
return true;
|
return true;
|
||||||
} else if (e->type() == QEvent::Resize) {
|
} else if (e->type() == QEvent::Resize) {
|
||||||
const auto weak = Ui::MakeWeak(this);
|
const auto weak = Ui::MakeWeak(this);
|
||||||
updateState();
|
updateState();
|
||||||
if (weak) {
|
if (weak) {
|
||||||
_innerResizes.fire({});
|
_innerResizes.fire({});
|
||||||
}
|
}
|
||||||
} else if (e->type() == QEvent::Move) {
|
} else if (e->type() == QEvent::Move) {
|
||||||
updateState();
|
updateState();
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
|
|
@ -903,8 +903,10 @@ void ElasticScroll::updateState() {
|
||||||
const auto delta = std::max(
|
const auto delta = std::max(
|
||||||
std::min(nowOverscroll - wasOverscroll, from),
|
std::min(nowOverscroll - wasOverscroll, from),
|
||||||
0);
|
0);
|
||||||
from -= delta;
|
if (delta) {
|
||||||
till -= delta;
|
applyScrollTo(from - delta);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
setState({
|
setState({
|
||||||
.visibleFrom = from,
|
.visibleFrom = from,
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue