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 handler event affects animations #66

Closed
btzr-io opened this issue Oct 19, 2019 · 4 comments
Closed

Zoom handler event affects animations #66

btzr-io opened this issue Oct 19, 2019 · 4 comments
Labels

Comments

@btzr-io
Copy link
Owner

btzr-io commented Oct 19, 2019

Describe the bug
The zoom handler function makes the zoom animations choppy and slow.
I suspect is caused by the new implentation on the getTargetZoom function.

To Reproduce
Steps to reproduce the behavior:

  1. Use the wheel mouse button to zoom in / out.
  2. See animations.

Expected behavior
Smooth zoom animations

this.viewer.addHandler('zoom', ({ zoom }) => {
const { viewport } = this.viewer
const max = viewport.getMaxZoom()
const min = viewport.getMinZoom()
const currentZoom = parseInt((zoom / this.getTargetZoom()) * 100)
const canZoomIn = zoom < max && currentZoom < 100
const canZoomOut = zoom > min
this.context.updateState({ currentZoom, canZoomIn, canZoomOut })
})

See: Optimize getTargetZoom function #67

This was referenced Oct 19, 2019
@btzr-io btzr-io changed the title Zoom handler function is not optimized Zoom handler event affects animations Oct 19, 2019
@Brostafa
Copy link

Brostafa commented Oct 19, 2019

@btzr-io #73

@btzr-io
Copy link
Owner Author

btzr-io commented Oct 20, 2019

Update

The issue appears to be more noticeable on firefox I tested on chrome, brave and electron and its working really smooth.

@btzr-io
Copy link
Owner Author

btzr-io commented Oct 20, 2019

Not sure if this is related: openseadragon/openseadragon#1078

@btzr-io btzr-io reopened this Oct 21, 2019
@btzr-io
Copy link
Owner Author

btzr-io commented Oct 21, 2019

This require more work and testing.

@btzr-io btzr-io added the important Requires inmediate attention label Oct 22, 2019
@btzr-io btzr-io closed this as completed Dec 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants