Skip to content

Commit

Permalink
undo floating point rounding accuracy check
Browse files Browse the repository at this point in the history
  • Loading branch information
NANI-SORE committed Nov 19, 2023
1 parent ece0128 commit a5a21da
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/src/core/photo_view_hit_corners.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ mixin HitCornersDetector on PhotoViewControllerDelegate {
HitCorners _hitCornersX() {
final double childWidth = scaleBoundaries.childSize.width * scale;
final double screenWidth = scaleBoundaries.outerSize.width;
if ((screenWidth - childWidth) > -0.001) {
if (screenWidth >= childWidth) {
return const HitCorners(true, true);
}
final x = -position.dx;
Expand All @@ -18,7 +18,7 @@ mixin HitCornersDetector on PhotoViewControllerDelegate {
HitCorners _hitCornersY() {
final double childHeight = scaleBoundaries.childSize.height * scale;
final double screenHeight = scaleBoundaries.outerSize.height;
if ((screenHeight - childHeight) > -0.001) {
if (screenHeight >= childHeight) {
return const HitCorners(true, true);
}
final y = -position.dy;
Expand Down
4 changes: 2 additions & 2 deletions lib/src/utils/photo_view_utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ double getScaleForScaleState(
);
case PhotoViewScaleState.zoomedIn:
return _clampSize(
scaleBoundaries.initialScale, // maxScale
scaleBoundaries.maxScale,
scaleBoundaries,
);
case PhotoViewScaleState.zoomedOut:
return _clampSize(
scaleBoundaries.initialScale, // minScale
scaleBoundaries.minScale,
scaleBoundaries,
);
case PhotoViewScaleState.covering:
Expand Down

0 comments on commit a5a21da

Please sign in to comment.