mirror of
https://github.com/rustdesk/rustdesk.git
synced 2025-05-11 10:26:19 +02:00
fix: mobile, don't reset canvas on metrics changed (#10463)
Signed-off-by: fufesou <linlong1266@gmail.com>
This commit is contained in:
parent
b5d54debce
commit
222dbf12cd
1 changed files with 6 additions and 3 deletions
|
@ -1500,13 +1500,15 @@ class CanvasModel with ChangeNotifier {
|
|||
return max(bottom - MediaQueryData.fromView(ui.window).padding.top, 0);
|
||||
}
|
||||
|
||||
updateSize() => _size = getSize();
|
||||
|
||||
updateViewStyle({refreshMousePos = true, notify = true}) async {
|
||||
final style = await bind.sessionGetViewStyle(sessionId: sessionId);
|
||||
if (style == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
_size = getSize();
|
||||
updateSize();
|
||||
final displayWidth = getDisplayWidth();
|
||||
final displayHeight = getDisplayHeight();
|
||||
final viewStyle = ViewStyle(
|
||||
|
@ -1543,7 +1545,7 @@ class CanvasModel with ChangeNotifier {
|
|||
_resetCanvasOffset(int displayWidth, int displayHeight) {
|
||||
_x = (size.width - displayWidth * _scale) / 2;
|
||||
_y = (size.height - displayHeight * _scale) / 2;
|
||||
if (isMobile && _lastViewStyle.style == kRemoteViewStyleOriginal) {
|
||||
if (isMobile) {
|
||||
_moveToCenterCursor();
|
||||
}
|
||||
}
|
||||
|
@ -1736,7 +1738,8 @@ class CanvasModel with ChangeNotifier {
|
|||
_timerMobileFocusCanvasCursor?.cancel();
|
||||
_timerMobileFocusCanvasCursor =
|
||||
Timer(Duration(milliseconds: 100), () async {
|
||||
await updateViewStyle(refreshMousePos: false, notify: false);
|
||||
updateSize();
|
||||
_resetCanvasOffset(getDisplayWidth(), getDisplayHeight());
|
||||
notifyListeners();
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue