Merge pull request #3413 from fufesou/fix/check_dividing_zero

check divide by 0
This commit is contained in:
RustDesk 2023-02-27 23:43:15 +08:00 committed by GitHub
commit 6086e9cb33
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -810,6 +810,10 @@ class CanvasModel with ChangeNotifier {
double get tabBarHeight => stateGlobal.tabBarHeight;
moveDesktopMouse(double x, double y) {
if (size.width == 0 || size.height == 0) {
return;
}
// On mobile platforms, move the canvas with the cursor.
final dw = getDisplayWidth() * _scale;
final dh = getDisplayHeight() * _scale;