These are chat archives for openseadragon/openseadragon

23rd
Jul 2017
Oswaldo Capriles
@pipriles
Jul 23 2017 03:55
Hello very nice library
Any ideas in how to do something like panning mode pressing space
Ian Gilman
@iangilman
Jul 23 2017 17:53
@pipriles How do you mean? Panning with the keyboard? Or only allowing the user to pan with the mouse after they press the spacebar?
Alexey Tikhonov
@altert
Jul 23 2017 18:57
@iangilman I'm working on altert/OpenseadragonFabricjsOverlay#18
the problem is - I can use viewport coordinates, but for zoom I still need viewportToImageZoom
so I need some kind of current image to base it on. What do you think would be correct approach?
Ian Gilman
@iangilman
Jul 23 2017 18:59
@altert how come?
For comparison, https://github.com/openseadragon/svg-overlay uses only viewport coordinates.
Alexey Tikhonov
@altert
Jul 23 2017 19:03
hmm this? ``` var scale = this._viewer.viewport._containerInnerSize.x * zoom;
Ian Gilman
@iangilman
Jul 23 2017 19:03
Those are the web coordinates for the viewer.
Remember, we've got three coordinate systems: Web, viewport, and image. You definitely need to utilize both web and viewport, but I think image is irrelevant for the purposes of your plug-in.
(Obviously some of your users might care about image coordinates, but then it's up to them to do the right conversion between viewport and image)
Alexey Tikhonov
@altert
Jul 23 2017 19:06
btw, there is a development on chrome pointers/fabric issue
Ian Gilman
@iangilman
Jul 23 2017 19:06
Yes, that's wonderful! I haven't fully looked into it, but I intend to follow along.
Alexey Tikhonov
@altert
Jul 23 2017 19:07
@faibk made edited fabric version, that supports pointer events
I also did variant of the same, so I think one of the versions will be bundled with plugin until fabric supports pointer events
If possible, I will try to make PR to fabric code
or @faibk)
Ian Gilman
@iangilman
Jul 23 2017 19:09
Interesting. Sounds good. Yes, good to get the fix back in the mainline!
Sounds like the issue is all on the Fabric side, then, rather than OpenSeadragon?
Alexey Tikhonov
@altert
Jul 23 2017 19:11
yes, it seems so
OpenSeadragon switches to pointer events, if they are supported
but Fabric doesn't support them
Ian Gilman
@iangilman
Jul 23 2017 19:12
cool, yeah, @msalsbery put a lot of work into that!
Well, I'm glad it's getting sorted out.
… And that you are looking into the coordinates thing.
Does what I said about the coordinates make sense? I'm happy to discuss further…
Alexey Tikhonov
@altert
Jul 23 2017 19:16
well it makes, but I need to think and try some things)
Ian Gilman
@iangilman
Jul 23 2017 19:16
Cool :-)
I guess it helps if you have a multi-image example to play with
just slap a few images onto the world and play around
Alexey Tikhonov
@altert
Jul 23 2017 19:20
maybe my problem is that I created fabric objects in image coordinates and started from there
Ian Gilman
@iangilman
Jul 23 2017 19:22
well, one way to think about it is to create fabric objects in whatever coordinate system feels comfortable for fabric, and just use that as your viewport coordinates for OpenSeadragon
viewport coordinates are whatever you want… By default it goes from 0 to 1 for the width of the image, but you can really do whatever you want. If your image is 2000 pixels wide you can say the viewport coordinates go from 0 to 2000.
Alexey Tikhonov
@altert
Jul 23 2017 19:25
ok. I need to process this) thanks
Ian Gilman
@iangilman
Jul 23 2017 19:26
It only really becomes relevant when you have multiple images. Let's say you have decided to have your viewport coordinates run in the thousands. Then you want to have two images side-by-side. One of them runs from 0 to 1000 in viewport coordinates and the other runs from 1000 to 2000 in viewport coordinates. In actuality the first image is indeed 1000 pixels wide, so there the image coordinates and the viewport coordinates line up. However, the second image is maybe 2000 pixels one, so over there there are two image pixels for every one viewport unit.
Meanwhile you have a fabric overlay that is 2000 fabric units wide on top of it all.
It's the fact that viewport coordinates are not necessarily tied to the pixels of any one image that allows you to lay everything out the way you want.
I assume you've seen this, but if you haven't: http://openseadragon.github.io/examples/viewport-coordinates/
Anyway, I think the key is remembering that the viewport coordinates can be whatever you want. 0 to 1000, 0 to 1, whatever.
Okay, stepping away for a bit… Happy processing :-)
Alexey Tikhonov
@altert
Jul 23 2017 19:37
thanks!)