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

Bug in Zoom/Pan Calculation #141

Closed
314159265meow opened this issue Sep 13, 2021 · 1 comment · Fixed by #152
Closed

Bug in Zoom/Pan Calculation #141

314159265meow opened this issue Sep 13, 2021 · 1 comment · Fixed by #152
Labels
bug Something isn't working fixed/done

Comments

@314159265meow
Copy link

Hi,
I think I found a small bug in src/Blazor.Diagrams.Core/Behaviors/ZoomBehavior.cs. In line 41 you set the newZoom Variable to

newZoom = Math.Clamp(newZoom, Diagram.Options.Zoom.Minimum, Diagram.Options.Zoom.Maximum);

But the previous value has already been used to calculate the pan change. So if you zoom to maximum/minimum, you'll notice a small viewport jump. This can be fixed if you move the lines 41-43 above the pan calculation to line 27.

@zHaytam zHaytam added the bug Something isn't working label Sep 29, 2021
@zHaytam
Copy link
Collaborator

zHaytam commented Sep 29, 2021

Hello, sorry for the delay I thought I replied.

You are right, I can see the small viewport jump, I'll fix this in the next version! Thanks for pointing it out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed/done
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants