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