Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
dom
2026-02-07 12:32:29 +08:00
parent d253ef468b
commit a380bcd96a
2 changed files with 4 additions and 3 deletions

View File

@@ -26,11 +26,12 @@ class ImageHorizontalDragGestureRecognizer
if (_initialPosition == null) { if (_initialPosition == null) {
return true; return true;
} }
final scale = transformationController.value.row0[0]; final storage = transformationController.value.storage;
final scale = storage[0];
if (scale <= 1.0) { if (scale <= 1.0) {
return true; return true;
} }
final double xOffset = transformationController.value.row0[3]; final double xOffset = storage[12];
final double boundaryEnd = width * scale; final double boundaryEnd = width * scale;
final int xPos = (boundaryEnd + xOffset).round(); final int xPos = (boundaryEnd + xOffset).round();
return (boundaryEnd.round() == xPos && return (boundaryEnd.round() == xPos &&

View File

@@ -192,7 +192,7 @@ class _InteractiveviewerGalleryState extends State<InteractiveviewerGallery>
minScale: widget.minScale, minScale: widget.minScale,
onDismissed: Get.back, onDismissed: Get.back,
onInteractionEnd: (_) => onInteractionEnd: (_) =>
_onScaleChanged(_transformationController.value.row0[0]), _onScaleChanged(_transformationController.value.storage[0]),
child: PageView<ImageHorizontalDragGestureRecognizer>.builder( child: PageView<ImageHorizontalDragGestureRecognizer>.builder(
onPageChanged: _onPageChanged, onPageChanged: _onPageChanged,
controller: _pageController, controller: _pageController,