diff --git a/CHANGELOG.md b/CHANGELOG.md index 045d54747..ab54aedef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. ## [Unreleased] +### Fixed + +- swiping images for some combinations of screen size, device pixel ratio, and image size + ## [v1.12.7] - 2025-03-16 ### Added diff --git a/plugins/aves_magnifier/lib/src/pan/edge_hit_detector.dart b/plugins/aves_magnifier/lib/src/pan/edge_hit_detector.dart index 9aa0329fa..04277a7a8 100644 --- a/plugins/aves_magnifier/lib/src/pan/edge_hit_detector.dart +++ b/plugins/aves_magnifier/lib/src/pan/edge_hit_detector.dart @@ -1,5 +1,6 @@ import 'package:aves_magnifier/src/controller/controller_delegate.dart'; import 'package:equatable/equatable.dart'; +import 'package:flutter/foundation.dart'; import 'package:flutter/widgets.dart'; mixin EdgeHitDetector on AvesMagnifierControllerDelegate { @@ -15,7 +16,7 @@ mixin EdgeHitDetector on AvesMagnifierControllerDelegate { final x = -position.dx; final range = _boundaries.getXEdges(scale: _scale); - return EdgeHit(x <= range.min, x >= range.max); + return EdgeHit(x <= range.min + precisionErrorTolerance, x >= range.max - precisionErrorTolerance); } EdgeHit getYEdgeHit() { @@ -25,7 +26,7 @@ mixin EdgeHitDetector on AvesMagnifierControllerDelegate { final y = -position.dy; final range = _boundaries.getYEdges(scale: _scale); - return EdgeHit(y <= range.min, y >= range.max); + return EdgeHit(y <= range.min + precisionErrorTolerance, y >= range.max - precisionErrorTolerance); } bool shouldMoveX(Offset move, bool canFling) {