thatcher / openseadragon

This project has moved to its new github organization at github.com/openseadragon, please join us!
http://openseadragon,github.com/
37 stars 14 forks source link

constrainDuringPan #4

Closed ghost closed 11 years ago

ghost commented 12 years ago

In the original Seadragon API, one could set

Seadragon.Config.constrainDuringPan = true

... and the image could not be dragged out of bounds, meaning you couldn't see the image edges and/or the background. This is a pretty useful option which can be combined with

Seadragon.Config.visibilityRatio = 1.0

... in order to avoid showing the background.

thatcher commented 12 years ago

Nice, I hadn't run into this in the OpenSeadragon code base but I bet the feature could be easily enabled. Thank you for creating a ticket to track it! I only check issues every couple of weeks because of scheduling constraints but the issue tickets help me track TBD stuff.

This feature maps is related to a feature I need to work on anyway, which allows the user to push a toggle button to get a "best-fit-on-the-shortest-side" which OpenSeadragon on provides for the longest side currently.

I'm focusing on accessibility issues first since it's a lot more work if saved for later, but I should be able to get to this in the next 2 weeks.

Thatcher

thatcher commented 11 years ago

I did some work on this, so now if you set the following combination it should achieve the same effect:

    visibilityRatio:    1,
    minZoomLevel:       1,
    defaultZoomLevel:   1,

I'll try to get an example on the web site for you to look at.

thatcher commented 11 years ago

this has an even more complete implementation now with that configuration parameter, "constrainDuringPan" being implemented per your request.

OpenSeadragon({ ... visibilityRatio: 1.0, constrainDuringPan: true ... });

you can try it in the first example on this page:

http://thatcher.github.com/openseadragon/examples/ui-zoom-and-pan/