Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

calcZoomStopTable hangs app if z == 0 #79

Closed
jezell opened this issue Feb 20, 2024 · 1 comment
Closed

calcZoomStopTable hangs app if z == 0 #79

jezell opened this issue Feb 20, 2024 · 1 comment

Comments

@jezell
Copy link

jezell commented Feb 20, 2024

Sometimes we enter this while loop with a z value of zero which causes the app to hang. Not sure why it is zero, but maybe if it is zero it should not enter the while loop so it doesn't hang?

  void _calcZoomStopTable() {
    _zoomStops.clear();
    double z;
    if (_alternativeFitScale != null &&
        !_areZoomsAlmostIdentical(_alternativeFitScale!, _coverScale!)) {
      if (_alternativeFitScale! < _coverScale!) {
        _zoomStops.add(_alternativeFitScale!);
        z = _coverScale!;
      } else {
        _zoomStops.add(_coverScale!);
        z = _alternativeFitScale!;
      }
    } else {
      z = _coverScale!;
    }
    while (z < PdfViewerController.maxZoom) {
      _zoomStops.add(z);
      z *= 2;
    }
  }
espresso3389 added a commit that referenced this issue Feb 21, 2024
@espresso3389
Copy link
Owner

Fixed on 1.0.10 and 0.4.46.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants