mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-12-01 09:36:08 +03:00
update unit tests
This commit is contained in:
parent
5aca85fe21
commit
78c6295acf
@ -577,10 +577,11 @@ $.Viewport.prototype = {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var newViewportBounds = this.viewerElementToViewportRectangle(newBounds);
|
var constraintApplied = xConstrained || yConstrained;
|
||||||
|
var newViewportBounds = constraintApplied ? this.viewerElementToViewportRectangle(newBounds) : bounds.clone();
|
||||||
newViewportBounds.xConstrained = xConstrained;
|
newViewportBounds.xConstrained = xConstrained;
|
||||||
newViewportBounds.yConstrained = yConstrained;
|
newViewportBounds.yConstrained = yConstrained;
|
||||||
newViewportBounds.constraintApplied = xConstrained || yConstrained;
|
newViewportBounds.constraintApplied = constraintApplied;
|
||||||
|
|
||||||
return newViewportBounds;
|
return newViewportBounds;
|
||||||
},
|
},
|
||||||
|
@ -539,7 +539,7 @@
|
|||||||
var bounds = viewport.getBounds();
|
var bounds = viewport.getBounds();
|
||||||
Util.assertRectangleEquals(
|
Util.assertRectangleEquals(
|
||||||
assert,
|
assert,
|
||||||
new OpenSeadragon.Rect(1.2071067811865466, 0.20710678118654746, Math.sqrt(2), Math.sqrt(2), 45),
|
new OpenSeadragon.Rect(1.0, 0.0, Math.sqrt(2), Math.sqrt(2), 45),
|
||||||
bounds,
|
bounds,
|
||||||
EPSILON,
|
EPSILON,
|
||||||
"Viewport.applyConstraints with rotation should move viewport.");
|
"Viewport.applyConstraints with rotation should move viewport.");
|
||||||
@ -564,7 +564,7 @@
|
|||||||
var bounds = viewport.getBounds();
|
var bounds = viewport.getBounds();
|
||||||
Util.assertRectangleEquals(
|
Util.assertRectangleEquals(
|
||||||
assert,
|
assert,
|
||||||
new OpenSeadragon.Rect(1.2071067811865466, 0.20710678118654746, Math.sqrt(2), Math.sqrt(2), 45),
|
new OpenSeadragon.Rect(1.0, 0.0, Math.sqrt(2), Math.sqrt(2), 45),
|
||||||
bounds,
|
bounds,
|
||||||
EPSILON,
|
EPSILON,
|
||||||
"Viewport.applyConstraints flipped and with rotation should move viewport.");
|
"Viewport.applyConstraints flipped and with rotation should move viewport.");
|
||||||
|
Loading…
Reference in New Issue
Block a user