These are chat archives for openseadragon/openseadragon

9th
Dec 2016
Patrick Liechty
@patrickliechty
Dec 09 2016 00:38
I want to know if the mouse point is currently inside of the image bounds. The dragHandler gives you relative positions. I want to stop dragging when it hits the image bounds.
Ian Gilman
@iangilman
Dec 09 2016 18:43
@patrickliechty I assume this is some other drag than panning? Let me see...
The event.position from the dragHandler is in web coordinates relative to the viewer element. You can call viewer.viewport.viewerElementToViewportCoordinates(event.position) to get it in viewport coordinates. Then you can call viewer.world.getItemAt(0).getBounds() to know the image location in viewport coordinates (assuming you only have a single image)... then you just compare the two