mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-25 06:36:11 +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.yConstrained = yConstrained;
|
||||
newViewportBounds.constraintApplied = xConstrained || yConstrained;
|
||||
newViewportBounds.constraintApplied = constraintApplied;
|
||||
|
||||
return newViewportBounds;
|
||||
},
|
||||
|
@ -539,7 +539,7 @@
|
||||
var bounds = viewport.getBounds();
|
||||
Util.assertRectangleEquals(
|
||||
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,
|
||||
EPSILON,
|
||||
"Viewport.applyConstraints with rotation should move viewport.");
|
||||
@ -564,7 +564,7 @@
|
||||
var bounds = viewport.getBounds();
|
||||
Util.assertRectangleEquals(
|
||||
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,
|
||||
EPSILON,
|
||||
"Viewport.applyConstraints flipped and with rotation should move viewport.");
|
||||
|
Loading…
Reference in New Issue
Block a user