These are chat archives for openseadragon/openseadragon

16th
Oct 2014
Antoine Vandecreme
@avandecreme
Oct 16 2014 14:01
hello, test from IRC :)
Ian Gilman
@iangilman
Oct 16 2014 16:32
@avandecreme nice! How is it working from IRC?
Antoine Vandecreme
@avandecreme
Oct 16 2014 17:01
@iangilman: https://irc.gitter.im/ :)
Ian Gilman
@iangilman
Oct 16 2014 17:02
Yes... I just haven't given it a try.
Antoine Vandecreme
@avandecreme
Oct 16 2014 17:02
seems to work good
Ian Gilman
@iangilman
Oct 16 2014 17:02
So I guess I'm asking "how well is it working" rather than "how is it possible that it's working".
Excellent :-)
...seems like a good balance between providing IRC support for those who prefer that and the webapp for those who don't.
Antoine Vandecreme
@avandecreme
Oct 16 2014 17:04
yeah, I don't really want to have my browser open on their page at all time
Ian Gilman
@iangilman
Oct 16 2014 20:08
@avandecreme Yup. But for me it makes sense because I haven't gotten around to setting up one of those "remember all of this channel while I'm not logged into it" things.
@aeschylus I'm continuing to work on the margins thing. It's coming along, but there are lots of details to attend to.
aeschylus
@aeschylus
Oct 16 2014 20:56
@iangilman Cool. Hopefully it can be sorted out this week. Right now though the "mouseup" thing is more blocking on the annotations sprint we're having with some people who have flown in to work on them. Not being able to capture mouseup events means I can't create a drag interaction that ends when the mouse is released to create a rectangle.
Ian Gilman
@iangilman
Oct 16 2014 20:57
Okay; I'll switch over to that.
aeschylus
@aeschylus
Oct 16 2014 20:58
Thanks. Let me know if I can help in any way. I'm just trying to code around it for now.
Ian Gilman
@iangilman
Oct 16 2014 21:05
@aeschylus have you tried viewer.addHandler('canvas-release'?
That's working for me.
aeschylus
@aeschylus
Oct 16 2014 21:06
Hm. I'll experiment with that. Ultimately I need to be able to capture a mousedown+mousemove when a flag is set for "annotation mode", and deactivate openseadragon's normal behaviour while the annotation is being dragged over the canvas.
Ian Gilman
@iangilman
Oct 16 2014 21:07
And you've got the mousedown + mousemove part working but not the mouseup?
aeschylus
@aeschylus
Oct 16 2014 21:08
Not quite. The mousedown event is registered, but mousemove doesn't engage until after the mouse button is released
Ian Gilman
@iangilman
Oct 16 2014 21:08
And you're doing mousedown + mousemove with jQuery rather than using canvas-drag?
aeschylus
@aeschylus
Oct 16 2014 21:09
I was going to. Let me try with canvas-drag and canvas-release. Will I be able to deactivate the behaviours of those while receiving the events? For instance, when the user drags the mouse to create a rectangle, the canvas needs to be stationary.
Ian Gilman
@iangilman
Oct 16 2014 21:14
Yes, this works:
        viewer.panHorizontal = false;
        viewer.panVertical = false;

        viewer.addHandler('canvas-drag', function() {
            console.log('drag');
        });
        viewer.addHandler('canvas-release', function() {
            console.log('release');
        });
Hmm... not sure how to get that formatting right... anyway, see panHorizontal/panVertical.
aeschylus
@aeschylus
Oct 16 2014 21:16
Alright. I'm looking through the events now. Let me test.
Ian Gilman
@iangilman
Oct 16 2014 21:17
Looks like we don't have an explicit "dragStart" event... should be easy enough for you, though... if (imNotCurrentlyDragging)
aeschylus
@aeschylus
Oct 16 2014 21:23
Yep, that works like a charm.
I'll read through these events more carefully. I hadn't considered using them.
It is also nice how you've made the event return things useful for getting mouse position, etc.
What is the place in the documentation to read about that custom "event" data that's passed from canvas-drag, etc.?
Glad it's working!
Back to viewer margins for me.
aeschylus
@aeschylus
Oct 16 2014 23:30
I have the mouse events returning a point and am trying to construct an openSeadragon Rect for an overlay. However, the point returned is in the wrong coordinate system for the Rect. How can I convert the event information into the coordinate system of the viewer to create an overlay?
Ian Gilman
@iangilman
Oct 16 2014 23:35
@aeschylus what coordinate system is the point coming back in?
Viewport has a ton of conversion functions.
aeschylus
@aeschylus
Oct 16 2014 23:36
Yes, sorry. I'm just looking at them. If the Point is in one of them, then it must be the image coordinates, but it may be the page coordinates.
Going to try some of these conversions.
Ian Gilman
@iangilman
Oct 16 2014 23:36
Is it the point you get from canvas-drag?
aeschylus
@aeschylus
Oct 16 2014 23:36
Yes.
Ian Gilman
@iangilman
Oct 16 2014 23:43
@aeschylus looks like it's in screen coordinates. What system do you need it in?
If it's for an overlay, presumably you want it in world coordinates?
aeschylus
@aeschylus
Oct 16 2014 23:44
Yes.
Ian Gilman
@iangilman
Oct 16 2014 23:44
So viewer.viewport.pointsFromPixels(event.position) would do it.
aeschylus
@aeschylus
Oct 16 2014 23:45
And then eventually I need a rect back in image coordinates, which I assume means its position on the fullSize image.
Okay, let me try pointsFromPixels
Rashmi Singhal
@rsinghal
Oct 16 2014 23:45
when drew is done, i am still having issues with the zoom and bounds stuff
I just saw your email - I will try that
aeschylus
@aeschylus
Oct 16 2014 23:53
Okay, that's working reasonably well. The overlay is being placed correctly, but it cannot be updated, so it always 0 pixels wide.
Rashmi Singhal
@rsinghal
Oct 16 2014 23:55
Ok, I think that did the trick, Ian. I removed all calls to getZoom and zoomTo and let bounds handle all of it.