mirror of
https://github.com/openseadragon/openseadragon.git
synced 2025-03-14 04:56:19 +03:00
Fix the function arguments for the required file
This commit is contained in:
parent
8fdd639bf0
commit
d31562e34f
@ -333,10 +333,10 @@
|
||||
assert.equal( quickClick, expected.quickClick, expected.description + 'clickHandler event.quick matches expected (' + expected.quickClick + ')' );
|
||||
}
|
||||
if ('speed' in expected) {
|
||||
Util.assessNumericValue(expected.speed, speed, 1.0, expected.description + 'Drag speed ');
|
||||
Util.assessNumericValue(assert, speed, expected.speed, 1.0, expected.description + 'Drag speed');
|
||||
}
|
||||
if ('direction' in expected) {
|
||||
Util.assessNumericValue(expected.direction, direction, 0.2, expected.description + 'Drag direction ');
|
||||
Util.assessNumericValue(assert, direction, expected.direction, 0.2, expected.description + 'Drag direction');
|
||||
}
|
||||
};
|
||||
|
||||
@ -868,7 +868,7 @@
|
||||
simulateDblTap();
|
||||
|
||||
var zoom = viewer.viewport.getZoom();
|
||||
Util.assessNumericValue(assert, originalZoom, zoom, epsilon,
|
||||
Util.assessNumericValue(assert, zoom, originalZoom, epsilon,
|
||||
"Zoom on double tap should be prevented");
|
||||
|
||||
// Reset event handler to original
|
||||
@ -878,7 +878,7 @@
|
||||
originalZoom *= viewer.zoomPerClick;
|
||||
|
||||
zoom = viewer.viewport.getZoom();
|
||||
Util.assessNumericValue(assert, originalZoom, zoom, epsilon,
|
||||
Util.assessNumericValue(assert, zoom, originalZoom, epsilon,
|
||||
"Zoom on double tap should not be prevented");
|
||||
|
||||
|
||||
|
@ -52,15 +52,15 @@
|
||||
|
||||
var assessNavigatorLocation = function (assert, expectedX, expectedY) {
|
||||
navigatorElement = navigatorElement || $(".navigator");
|
||||
Util.assessNumericValue(assert, expectedX, navigatorElement.offset().left, 10, ' Navigator x Position');
|
||||
Util.assessNumericValue(assert, expectedY, navigatorElement.offset().top, 10, ' Navigator y Position');
|
||||
Util.assessNumericValue(assert, navigatorElement.offset().left, expectedX, 10, ' Navigator x Position');
|
||||
Util.assessNumericValue(assert, navigatorElement.offset().top, expectedY, 10, ' Navigator y Position');
|
||||
};
|
||||
|
||||
var assessNavigatorSize = function (assert, expectedWidth, expectedHeight, msg) {
|
||||
msg = msg || "";
|
||||
navigatorElement = navigatorElement || $(".navigator");
|
||||
Util.assessNumericValue(assert, expectedWidth, navigatorElement.width(), 2, ' Navigator Width ' + msg);
|
||||
Util.assessNumericValue(assert, expectedHeight, navigatorElement.height(), 2, ' Navigator Height ' + msg);
|
||||
Util.assessNumericValue(assert, navigatorElement.width(), expectedWidth, 2, ' Navigator Width ' + msg);
|
||||
Util.assessNumericValue(assert, navigatorElement.height(), expectedHeight, 2, ' Navigator Height ' + msg);
|
||||
};
|
||||
|
||||
var assessNavigatorAspectRatio = function (assert, expectedAspectRatio, variance, msg) {
|
||||
@ -68,8 +68,8 @@
|
||||
navigatorElement = navigatorElement || $(".navigator");
|
||||
Util.assessNumericValue(
|
||||
assert,
|
||||
expectedAspectRatio,
|
||||
navigatorElement.width() / navigatorElement.height(),
|
||||
expectedAspectRatio,
|
||||
variance,
|
||||
' Navigator Aspect Ratio ' + msg
|
||||
);
|
||||
@ -80,13 +80,14 @@
|
||||
navigatorElement = navigatorElement || $(".navigator");
|
||||
Util.assessNumericValue(
|
||||
assert,
|
||||
expectedArea,
|
||||
navigatorElement.width() * navigatorElement.height(),
|
||||
expectedArea,
|
||||
Math.max(navigatorElement.width(), navigatorElement.height()),
|
||||
' Navigator Area ' + msg
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
var navigatorRegionBoundsInPoints = function () {
|
||||
var regionBoundsInPoints,
|
||||
expectedDisplayRegionWidth,
|
||||
@ -142,22 +143,23 @@
|
||||
var expectedBounds = navigatorRegionBoundsInPoints();
|
||||
Util.assessNumericValue(
|
||||
assert,
|
||||
expectedBounds.width,
|
||||
displayRegion.width() + viewer.navigator.totalBorderWidths.x,
|
||||
expectedBounds.width,
|
||||
2,
|
||||
status + ' Width synchronization'
|
||||
);
|
||||
Util.assessNumericValue(
|
||||
assert,
|
||||
expectedBounds.height,
|
||||
displayRegion.height() + viewer.navigator.totalBorderWidths.y,
|
||||
expectedBounds.height,
|
||||
2,
|
||||
status + ' Height synchronization'
|
||||
);
|
||||
Util.assessNumericValue(assert, expectedBounds.x, displayRegion.position().left, 2, status + ' Left synchronization');
|
||||
Util.assessNumericValue(assert, expectedBounds.y, displayRegion.position().top, 2, status + ' Top synchronization');
|
||||
Util.assessNumericValue(assert, displayRegion.position().left, expectedBounds.x, 2, status + ' Left synchronization');
|
||||
Util.assessNumericValue(assert, displayRegion.position().top, expectedBounds.y, 2, status + ' Top synchronization');
|
||||
};
|
||||
|
||||
|
||||
var waitForViewer = function () {
|
||||
return function (assert, handler, count, lastDisplayRegionLeft, lastDisplayWidth) {
|
||||
var viewerAndNavigatorDisplayReady = false,
|
||||
@ -271,14 +273,15 @@
|
||||
}
|
||||
Util.assessNumericValue(
|
||||
assert,
|
||||
1 / viewer.source.aspectRatio / 2,
|
||||
viewer.viewport.getCenter().y,
|
||||
1 / viewer.source.aspectRatio / 2,
|
||||
yPositionVariance,
|
||||
' Viewer at center, y coord'
|
||||
);
|
||||
Util.assessNumericValue(assert, 0.5, viewer.viewport.getCenter().x, 0.4, ' Viewer at center, x coord');
|
||||
Util.assessNumericValue(assert, viewer.viewport.getCenter().x, 0.5, 0.4, ' Viewer at center, x coord');
|
||||
};
|
||||
|
||||
|
||||
var assessViewerInCorner = function (theContentCorner, assert) {
|
||||
return function () {
|
||||
var expectedXCoordinate, expectedYCoordinate;
|
||||
@ -301,8 +304,8 @@
|
||||
if (viewer.viewport.getBounds().width < 1) {
|
||||
Util.assessNumericValue(
|
||||
assert,
|
||||
expectedXCoordinate,
|
||||
viewer.viewport.getBounds().x,
|
||||
expectedXCoordinate,
|
||||
0.04,
|
||||
' Viewer at ' + theContentCorner + ', x coord'
|
||||
);
|
||||
@ -310,8 +313,8 @@
|
||||
if (viewer.viewport.getBounds().height < 1 / viewer.source.aspectRatio) {
|
||||
Util.assessNumericValue(
|
||||
assert,
|
||||
expectedYCoordinate,
|
||||
viewer.viewport.getBounds().y,
|
||||
expectedYCoordinate,
|
||||
0.04,
|
||||
' Viewer at ' + theContentCorner + ', y coord'
|
||||
);
|
||||
|
@ -22,37 +22,26 @@
|
||||
assert.strictEqual(rect.degrees, 0, 'rect.degrees should be 0');
|
||||
|
||||
rect = new OpenSeadragon.Rect(0, 0, 1, 2, -405);
|
||||
Util.assessNumericValue(assert, Math.sqrt(2) / 2, rect.x, precision,
|
||||
'rect.x should be sqrt(2)/2');
|
||||
Util.assessNumericValue(assert, -Math.sqrt(2) / 2, rect.y, precision,
|
||||
'rect.y should be -sqrt(2)/2');
|
||||
Util.assessNumericValue(assert, 2, rect.width, precision,
|
||||
'rect.width should be 2');
|
||||
Util.assessNumericValue(assert, 1, rect.height, precision,
|
||||
'rect.height should be 1');
|
||||
assert.strictEqual(45, rect.degrees, 'rect.degrees should be 45');
|
||||
Util.assessNumericValue(assert, rect.x, Math.sqrt(2) / 2, precision, 'rect.x should be sqrt(2)/2');
|
||||
Util.assessNumericValue(assert, rect.y, -Math.sqrt(2) / 2, precision, 'rect.y should be -sqrt(2)/2');
|
||||
Util.assessNumericValue(assert, rect.width, 2, precision, 'rect.width should be 2');
|
||||
Util.assessNumericValue(assert, rect.height, 1, precision, 'rect.height should be 1');
|
||||
assert.strictEqual(rect.degrees, 45, 'rect.degrees should be 45');
|
||||
|
||||
rect = new OpenSeadragon.Rect(0, 0, 1, 2, 135);
|
||||
Util.assessNumericValue(assert, -Math.sqrt(2), rect.x, precision,
|
||||
'rect.x should be -sqrt(2)');
|
||||
Util.assessNumericValue(assert, -Math.sqrt(2), rect.y, precision,
|
||||
'rect.y should be -sqrt(2)');
|
||||
Util.assessNumericValue(assert, 2, rect.width, precision,
|
||||
'rect.width should be 2');
|
||||
Util.assessNumericValue(assert, 1, rect.height, precision,
|
||||
'rect.height should be 1');
|
||||
assert.strictEqual(45, rect.degrees, 'rect.degrees should be 45');
|
||||
Util.assessNumericValue(assert, rect.x, -Math.sqrt(2), precision, 'rect.x should be -sqrt(2)');
|
||||
Util.assessNumericValue(assert, rect.y, -Math.sqrt(2), precision, 'rect.y should be -sqrt(2)');
|
||||
Util.assessNumericValue(assert, rect.width, 2, precision, 'rect.width should be 2');
|
||||
Util.assessNumericValue(assert, rect.height, 1, precision, 'rect.height should be 1');
|
||||
assert.strictEqual(rect.degrees, 45, 'rect.degrees should be 45');
|
||||
|
||||
rect = new OpenSeadragon.Rect(0, 0, 1, 1, 585);
|
||||
Util.assessNumericValue(assert, 0, rect.x, precision,
|
||||
'rect.x should be 0');
|
||||
Util.assessNumericValue(assert, -Math.sqrt(2), rect.y, precision,
|
||||
'rect.y should be -sqrt(2)');
|
||||
Util.assessNumericValue(assert, 1, rect.width, precision,
|
||||
'rect.width should be 1');
|
||||
Util.assessNumericValue(assert, 1, rect.height, precision,
|
||||
'rect.height should be 1');
|
||||
assert.strictEqual(45, rect.degrees, 'rect.degrees should be 45');
|
||||
Util.assessNumericValue(assert, rect.x, 0, precision, 'rect.x should be 0');
|
||||
Util.assessNumericValue(assert, rect.y, -Math.sqrt(2), precision, 'rect.y should be -sqrt(2)');
|
||||
Util.assessNumericValue(assert, rect.width, 1, precision, 'rect.width should be 1');
|
||||
Util.assessNumericValue(assert, rect.height, 1, precision, 'rect.height should be 1');
|
||||
assert.strictEqual(rect.degrees, 45, 'rect.degrees should be 45');
|
||||
|
||||
});
|
||||
|
||||
QUnit.test('getTopLeft', function(assert) {
|
||||
|
@ -36,7 +36,7 @@
|
||||
|
||||
now = 500;
|
||||
spring.update();
|
||||
Util.assessNumericValue(assert, 5.5, spring.current.value, 0.00001, 'current value after first update');
|
||||
Util.assessNumericValue(assert, spring.current.value, 5.5, 0.00001, 'current value after first update');
|
||||
assert.equal(spring.target.value, 6, 'target value after first update');
|
||||
|
||||
now = 1000;
|
||||
@ -65,7 +65,7 @@
|
||||
|
||||
now = 500;
|
||||
spring.update();
|
||||
Util.assessNumericValue(assert, 1.41421, spring.current.value, 0.00001, 'current value after first update');
|
||||
Util.assessNumericValue(assert, spring.current.value, 1.41421, 0.00001, 'current value after first update');
|
||||
assert.equal(spring.target.value, 2, 'target value after first update');
|
||||
|
||||
now = 1000;
|
||||
|
Loading…
x
Reference in New Issue
Block a user