fix: scroll percent is auto reset after detecting displays change (#7845)
Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
parent
a6632632fa
commit
b403a7a25d
@ -1017,6 +1017,8 @@ class FfiModel with ChangeNotifier {
|
||||
}
|
||||
}
|
||||
}
|
||||
parent.target!.canvasModel
|
||||
.tryUpdateScrollStyle(Duration(milliseconds: 300), null);
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
@ -1412,10 +1414,20 @@ class CanvasModel with ChangeNotifier {
|
||||
if (refreshMousePos) {
|
||||
parent.target?.inputModel.refreshMousePos();
|
||||
}
|
||||
if (style == kRemoteViewStyleOriginal &&
|
||||
_scrollStyle == ScrollStyle.scrollbar) {
|
||||
updateScrollPercent();
|
||||
tryUpdateScrollStyle(Duration.zero, style);
|
||||
}
|
||||
|
||||
tryUpdateScrollStyle(Duration duration, String? style) async {
|
||||
if (_scrollStyle != ScrollStyle.scrollbar) return;
|
||||
style ??= await bind.sessionGetViewStyle(sessionId: sessionId);
|
||||
if (style != kRemoteViewStyleOriginal) {
|
||||
return;
|
||||
}
|
||||
|
||||
_resetScroll();
|
||||
Future.delayed(duration, () async {
|
||||
updateScrollPercent();
|
||||
});
|
||||
}
|
||||
|
||||
updateScrollStyle() async {
|
||||
|
Loading…
x
Reference in New Issue
Block a user