Add test for fitBounds with a rotated rectangle.

This commit is contained in:
Antoine Vandecreme 2016-05-10 21:19:33 -04:00
parent e4c29d649b
commit 0c398eacdb

View File

@ -471,14 +471,16 @@
new OpenSeadragon.Rect(0, -0.75, 0.5, 1), new OpenSeadragon.Rect(0, -0.75, 0.5, 1),
new OpenSeadragon.Rect(0.5, 0, 0.5, 0.8), new OpenSeadragon.Rect(0.5, 0, 0.5, 0.8),
new OpenSeadragon.Rect(0.75, 0.75, 0.5, 0.5), new OpenSeadragon.Rect(0.75, 0.75, 0.5, 0.5),
new OpenSeadragon.Rect(-0.3, -0.3, 0.5, 0.5) new OpenSeadragon.Rect(-0.3, -0.3, 0.5, 0.5),
new OpenSeadragon.Rect(0.5, 0.25, Math.sqrt(0.125), Math.sqrt(0.125), 45)
]; ];
var expectedRectsFitBounds = [ var expectedRectsFitBounds = [
new OpenSeadragon.Rect(-0.25, -0.75, 1, 1), new OpenSeadragon.Rect(-0.25, -0.75, 1, 1),
new OpenSeadragon.Rect(0.35, 0, 0.8, 0.8), new OpenSeadragon.Rect(0.35, 0, 0.8, 0.8),
new OpenSeadragon.Rect(0.75, 0.75, 0.5, 0.5), new OpenSeadragon.Rect(0.75, 0.75, 0.5, 0.5),
new OpenSeadragon.Rect(-0.3, -0.3, 0.5, 0.5) new OpenSeadragon.Rect(-0.3, -0.3, 0.5, 0.5),
new OpenSeadragon.Rect(0.25, 0.25, 0.5, 0.5)
]; ];
var expectedRectsFitBoundsWithRotation = [ var expectedRectsFitBoundsWithRotation = [
@ -505,6 +507,12 @@
-0.55, -0.55,
Math.sqrt(0.125) * 2, Math.sqrt(0.125) * 2,
Math.sqrt(0.125) * 2, Math.sqrt(0.125) * 2,
45),
new OpenSeadragon.Rect(
0.5,
0.25,
Math.sqrt(0.125),
Math.sqrt(0.125),
45) 45)
]; ];
@ -512,7 +520,8 @@
new OpenSeadragon.Rect(-0.25, -0.5, 1, 1), new OpenSeadragon.Rect(-0.25, -0.5, 1, 1),
new OpenSeadragon.Rect(0.35, 0, 0.8, 0.8), new OpenSeadragon.Rect(0.35, 0, 0.8, 0.8),
new OpenSeadragon.Rect(0.75, 0.75, 0.5, 0.5), new OpenSeadragon.Rect(0.75, 0.75, 0.5, 0.5),
new OpenSeadragon.Rect(-0.25, -0.25, 0.5, 0.5) new OpenSeadragon.Rect(-0.25, -0.25, 0.5, 0.5),
new OpenSeadragon.Rect(0.25, 0.25, 0.5, 0.5)
]; ];
asyncTest('fitBounds', function(){ asyncTest('fitBounds', function(){