disable scroll options when image is wrapped by window

Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
fufesou
2023-01-06 20:25:18 +08:00
parent 921b049e1e
commit 947b7c9a4d
4 changed files with 90 additions and 66 deletions

View File

@@ -402,12 +402,10 @@ class _ImagePaintState extends State<ImagePaint> {
onHover: (evt) {},
child: child));
final imageWidth = c.getDisplayWidth() * s;
final imageHeight = c.getDisplayHeight() * s;
final imageSize = Size(imageWidth, imageHeight);
bool overflow =
c.size.width < imageSize.width || c.size.height < imageSize.height;
if (overflow && c.scrollStyle == ScrollStyle.scrollbar) {
if (c.imageOverflow.isTrue && c.scrollStyle == ScrollStyle.scrollbar) {
final imageWidth = c.getDisplayWidth() * s;
final imageHeight = c.getDisplayHeight() * s;
final imageSize = Size(imageWidth, imageHeight);
final imageWidget = CustomPaint(
size: imageSize,
painter: ImagePainter(image: m.image, x: 0, y: 0, scale: s),