opt gesture -

opt:Auto recover cursor;Expand scale limit.
fix:twoFinger mistake
This commit is contained in:
csf
2022-07-02 21:24:49 +08:00
parent b32d643f8c
commit 4a0e047c03
3 changed files with 82 additions and 50 deletions

View File

@@ -310,19 +310,19 @@ class ImageModel with ChangeNotifier {
}
double get maxScale {
if (_image == null) return 1.0;
if (_image == null) return 1.5;
final size = MediaQueryData.fromWindow(ui.window).size;
final xscale = size.width / _image!.width;
final yscale = size.height / _image!.height;
return max(1.0, max(xscale, yscale));
return max(1.5, max(xscale, yscale));
}
double get minScale {
if (_image == null) return 1.0;
if (_image == null) return 1.5;
final size = MediaQueryData.fromWindow(ui.window).size;
final xscale = size.width / _image!.width;
final yscale = size.height / _image!.height;
return min(xscale, yscale);
return min(xscale, yscale) / 1.5;
}
}