mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-25 06:36:11 +03:00
viewerElementToImageCoordinates
This commit is contained in:
parent
c6dd2f213d
commit
d9bd3343cc
@ -47,6 +47,25 @@
|
||||
viewer.open('/test/data/testpattern.dzi');
|
||||
});
|
||||
*/
|
||||
asyncTest('viewerElementToImageCoordinates', function() {
|
||||
var openHandler = function(event) {
|
||||
viewer.removeHandler('open', openHandler);
|
||||
var viewport = viewer.viewport;
|
||||
|
||||
var orig = new OpenSeadragon.Point(
|
||||
getRandom(0, 500), getRandom(0, 500)
|
||||
);
|
||||
// The image is twice as large as the viewer.
|
||||
var expected = orig.times(2);
|
||||
var actual = viewport.viewerElementToImageCoordinates(orig);
|
||||
propEqual(actual, expected, "Coordinates converted correctly for " + orig);
|
||||
|
||||
start();
|
||||
};
|
||||
viewer.addHandler('open', openHandler);
|
||||
viewer.open('/test/data/testpattern.dzi');
|
||||
});
|
||||
|
||||
asyncTest('imageToViewerElementCoordinates', function() {
|
||||
var openHandler = function(event) {
|
||||
viewer.removeHandler('open', openHandler);
|
||||
|
Loading…
Reference in New Issue
Block a user