fromthepage icon indicating copy to clipboard operation
fromthepage copied to clipboard

"Image at top" zoom doesn't fit across the screen

Open anabasftp opened this issue 2 years ago • 1 comments

A transcriber says that the "image at top" layout doesn't make it easy for him to zoom in so that the image fits exactly across the screen. They added that it would be great if they could "stretch" the image so that it fits the screen and suggested adding a control to the toolbar, something like <->

unnamed

They also added that when choosing to 'always show in full screen', it is not possible to navigate to the next page from the current one.

anabasftp avatar Oct 14 '22 15:10 anabasftp

I had a quick glance across the OpenSeadragon docs. Turns out there's a convenient .fitHorizontally method. I tested this and it does exactly what we would need here, i.e. stretch the image so that the width fills the window exactly.

I'm not sure where the icons are located in the codebase. But in principle, it would just be a matter of:

  • Adding a suitable icon, mimicking the style of the current 'home' icon (cf. image above)
  • Wiring up this icon with a simple JavaScript click handler (in the _osd_div.html template?) like so:
document.getElementById('fit-width-button').addEventListener('click', function() {
  viewer.viewport.fitHorizontally();
});

If you point me to where the icons are, I can send a PR for this.

rsimon avatar Jan 18 '24 08:01 rsimon