cu-mkp / editioncrafter

Software for the development of EditionCrafter, digital critical edition publication tool
https://cu-mkp.github.io/editioncrafter/
MIT License
8 stars 3 forks source link

Fix zoom buttons #67

Closed camdendotlol closed 1 year ago

camdendotlol commented 1 year ago

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 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.