Skip to content

Commit

Permalink
(viewer) Fix vertical page offset detector
Browse files Browse the repository at this point in the history
  • Loading branch information
violet-dev committed Sep 12, 2020
1 parent 0007c62 commit 29fd599
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/pages/viewer/viewer_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,11 @@ class __VerticalImageViewerState extends State<_VerticalImageViewer>
}

int offset2Page(double offset) {
double xx = 0.0;
double xx = -96;
for (int i = 0; i < _cachedHeight.length; i++) {
xx += _loaded[i] ? _cachedHeight[i] : 300;
// xx += 4;
if (offset + 96 < xx) {
if (offset < xx) {
return i + 1;
}
}
Expand Down

0 comments on commit 29fd599

Please sign in to comment.