Skip to content

Commit 95a2334

Browse files
authored
Merge pull request #1 from lynmock/feature/fix_landscape_image
Fix intercept swipe gestures when image not zoomed in some cases bluefireteam#482
2 parents a13ca2f + 686bf73 commit 95a2334

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

example/lib/main.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ void main() => runApp(MyApp());
55

66
ThemeData theme = ThemeData(
77
primaryColor: Colors.black,
8-
backgroundColor: Colors.white10,
8+
canvasColor: Colors.white10,
99
fontFamily: 'PTSans',
1010
);
1111

lib/src/core/photo_view_hit_corners.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ mixin HitCornersDetector on PhotoViewControllerDelegate {
77
HitCorners _hitCornersX() {
88
final double childWidth = scaleBoundaries.childSize.width * scale;
99
final double screenWidth = scaleBoundaries.outerSize.width;
10-
if (screenWidth >= childWidth) {
10+
if (screenWidth - childWidth > -0.001) {
1111
return const HitCorners(true, true);
1212
}
1313
final x = -position.dx;
@@ -18,7 +18,7 @@ mixin HitCornersDetector on PhotoViewControllerDelegate {
1818
HitCorners _hitCornersY() {
1919
final double childHeight = scaleBoundaries.childSize.height * scale;
2020
final double screenHeight = scaleBoundaries.outerSize.height;
21-
if (screenHeight >= childHeight) {
21+
if (screenHeight - childHeight > -0.001) {
2222
return const HitCorners(true, true);
2323
}
2424
final y = -position.dy;

0 commit comments

Comments
 (0)