Fixes the zoom buttons in the viewer so they correctly zoom in and out.
Also, refactors ImageZoomControl to a function component as per #56 (the simplest refactor yet).
Low Level
I couldn't actually diagnose why they quit working between the previous release and now. The bug had the same symptoms as https://github.com/openseadragon/openseadragon/issues/516, but none of the solutions there worked. My initial guess was that something happened when I turned ImageView into a function component that caused the viewer to somehow lose track of the button elements between renders.
Either way, I noticed that the fixed zoom buttons were already programmatically setting zoom, so I created onZoom callbacks for the regular zooming and added onClick handlers to the buttons.
Also, as mentioned in the linked OSD issue above, I updated out method of preventing zoom-on-click from an option that lowered the zoom rate to 0 to an option that more narrowly disables zoom-on-click.
Summary
High Level
Fixes the zoom buttons in the viewer so they correctly zoom in and out.
Also, refactors
ImageZoomControl
to a function component as per #56 (the simplest refactor yet).Low Level
I couldn't actually diagnose why they quit working between the previous release and now. The bug had the same symptoms as https://github.com/openseadragon/openseadragon/issues/516, but none of the solutions there worked. My initial guess was that something happened when I turned
ImageView
into a function component that caused the viewer to somehow lose track of the button elements between renders.Either way, I noticed that the fixed zoom buttons were already programmatically setting zoom, so I created
onZoom
callbacks for the regular zooming and addedonClick
handlers to the buttons.Also, as mentioned in the linked OSD issue above, I updated out method of preventing zoom-on-click from an option that lowered the zoom rate to 0 to an option that more narrowly disables zoom-on-click.