mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-21 20:56:09 +03:00
Viewport and tiledImage test fixes
This commit is contained in:
parent
a7d9f7dcd5
commit
56ee5bd3c5
@ -38,6 +38,7 @@ OPENSEADRAGON CHANGELOG
|
||||
* Margins option to push the home region in from the edges of the Viewer (#505)
|
||||
* Rect and Point toString() functions are now consistent: rounding values to nearest hundredth
|
||||
* Overlays appear in the DOM immediately on open or addOverlay (#507)
|
||||
* imageLoaderLimit now works (#544)
|
||||
|
||||
1.2.0: (in progress)
|
||||
|
||||
|
@ -36,6 +36,7 @@
|
||||
|
||||
// dictionary from hash to private properties
|
||||
var THIS = {};
|
||||
var nextHash = 1;
|
||||
|
||||
/**
|
||||
*
|
||||
@ -89,7 +90,7 @@ $.Viewer = function( options ) {
|
||||
|
||||
//internal state and dom identifiers
|
||||
id: options.id,
|
||||
hash: options.hash || options.id,
|
||||
hash: options.hash || nextHash++,
|
||||
|
||||
//dom nodes
|
||||
/**
|
||||
|
@ -3,7 +3,7 @@
|
||||
(function () {
|
||||
var viewer;
|
||||
var VIEWER_ID = "example";
|
||||
var PREFIX_URL = "/build/openseadragon/images";
|
||||
var PREFIX_URL = "/build/openseadragon/images/";
|
||||
var SPRING_STIFFNESS = 100; // Faster animation = faster tests
|
||||
|
||||
module("viewport", {
|
||||
@ -425,9 +425,7 @@
|
||||
return el.times(window_boundary);
|
||||
},
|
||||
getExpected: function(orig, viewport) {
|
||||
var position, pos_point;
|
||||
position = viewer.element.getBoundingClientRect();
|
||||
pos_point = new OpenSeadragon.Point(position.top, position.left);
|
||||
var pos_point = OpenSeadragon.getElementOffset(viewer.element);
|
||||
return orig.minus(pos_point).divide(viewport.getContainerSize().x * ZOOM_FACTOR).plus(VIEWER_PADDING);
|
||||
},
|
||||
method: 'windowToViewportCoordinates'
|
||||
@ -441,9 +439,7 @@
|
||||
return el.times(viewer.source.dimensions.x);
|
||||
},
|
||||
getExpected: function(orig, viewport) {
|
||||
var position, pos_point;
|
||||
position = viewer.element.getBoundingClientRect();
|
||||
pos_point = new OpenSeadragon.Point(position.top, position.left);
|
||||
var pos_point = OpenSeadragon.getElementOffset(viewer.element);
|
||||
return orig.plus(pos_point).minus(VIEWER_PADDING.times(viewport.getContainerSize().x * ZOOM_FACTOR));
|
||||
},
|
||||
method: 'imageToWindowCoordinates'
|
||||
@ -458,9 +454,7 @@
|
||||
return el.times(window_boundary);
|
||||
},
|
||||
getExpected: function(orig, viewport) {
|
||||
var position, pos_point;
|
||||
position = viewer.element.getBoundingClientRect();
|
||||
pos_point = new OpenSeadragon.Point(position.top, position.left);
|
||||
var pos_point = OpenSeadragon.getElementOffset(viewer.element);
|
||||
return orig.minus(pos_point).divide(viewport.getContainerSize().x * ZOOM_FACTOR).plus(VIEWER_PADDING);
|
||||
},
|
||||
method: 'windowToViewportCoordinates'
|
||||
@ -474,9 +468,7 @@
|
||||
return el.times(viewer.source.dimensions.x);
|
||||
},
|
||||
getExpected: function(orig, viewport) {
|
||||
var position, pos_point;
|
||||
position = viewer.element.getBoundingClientRect();
|
||||
pos_point = new OpenSeadragon.Point(position.top, position.left);
|
||||
var pos_point = OpenSeadragon.getElementOffset(viewer.element);
|
||||
return orig.minus(VIEWER_PADDING).times(viewport.getContainerSize().x * ZOOM_FACTOR).plus(pos_point);
|
||||
},
|
||||
method: 'viewportToWindowCoordinates'
|
||||
|
Loading…
Reference in New Issue
Block a user