rustdesk 2023-12-04 20:58:29 +08:00
parent 93aac0bc99
commit 674305ce29

View File

@ -421,11 +421,10 @@ class FfiModel with ChangeNotifier {
return; return;
} }
if (newRect != _rect) { if (newRect != _rect) {
if (updateCursorPos) {
if (newRect.left != _rect?.left || newRect.top != _rect?.top) { if (newRect.left != _rect?.left || newRect.top != _rect?.top) {
parent.target?.cursorModel parent.target?.cursorModel.updateDisplayOrigin(
.updateDisplayOrigin(newRect.left, newRect.top); newRect.left, newRect.top,
} updateCursorPos: updateCursorPos);
} }
_rect = newRect; _rect = newRect;
parent.target?.canvasModel parent.target?.canvasModel
@ -1842,12 +1841,14 @@ class CursorModel with ChangeNotifier {
notifyListeners(); notifyListeners();
} }
updateDisplayOrigin(double x, double y) { updateDisplayOrigin(double x, double y, {updateCursorPos = true}) {
_displayOriginX = x; _displayOriginX = x;
_displayOriginY = y; _displayOriginY = y;
if (updateCursorPos) {
_x = x + 1; _x = x + 1;
_y = y + 1; _y = y + 1;
parent.target?.inputModel.moveMouse(x, y); parent.target?.inputModel.moveMouse(x, y);
}
parent.target?.canvasModel.resetOffset(); parent.target?.canvasModel.resetOffset();
notifyListeners(); notifyListeners();
} }