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

Zoom In / Zoom Out API calls don't behave as expected depending on initialZoomLevel #59

Open
vicatcu opened this issue Jul 18, 2023 · 0 comments

Comments

@vicatcu
Copy link

vicatcu commented Jul 18, 2023

Describe the bug
With the following configuration:

  panZoomConfig: PanZoomConfig = new PanZoomConfig({
    panOnClickDrag: true,
    zoomOnDoubleClick: true,
    zoomOnMouseWheel: true,
    initialZoomLevel: 5,
  });

Calling api.zoomOut() initially works, but then right afterward calling api.zoomIn() does not do anything. Calling api.zoomIn() initially actually causes it the image to zoom out.

It behaves as expected with { initialZoomLevel: 3 }, but not with { initialZoomLevel: 5 }

Reduced Test Case
https://stackblitz.com/edit/ngx-panzoom-test-10-2-s6zgpf

To Reproduce
Steps to reproduce the behavior:

  1. Click Zoom In button
  2. Observe it actually Zooms Out
  3. Refresh the page
  4. Click the Zoom Out button
  5. Click the Zoom In button
  6. Observe it stays at the current Zoom level
  7. Click Zoom Out button again
  8. Click Zoom In button again
  9. That works as expected

Expected behavior
I expect api.zoomIn to always Zoom In at up to some limit (e.g. initial zoom).
I expect to be able to get back to the initial zoom level by using api.zoomIn.

Screenshots
Not applicable

Desktop (please complete the following information):

  • OS: Ubuntu 20.04
  • Browser: Chrome
  • Version: 114.0.5735.198 (Official Build) (64-bit)

Smartphone (please complete the following information):
N/A

Additional context
N/A

@vicatcu vicatcu changed the title [BUG] - Bug Name Goes Here Zoom In / Zoom Out API calls don't behave as expected Jul 20, 2023
@vicatcu vicatcu changed the title Zoom In / Zoom Out API calls don't behave as expected Zoom In / Zoom Out API calls don't behave as expected depending on initialZoomLevel Jul 20, 2023
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

1 participant