add a static function to make a Bounds from a Size. test included.

git-svn-id: http://svn.openlayers.org/trunk/openlayers@531 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
euzuro
2006-06-06 16:52:45 +00:00
parent 07b621b85c
commit 450f7b0460
2 changed files with 31 additions and 0 deletions
+14
View File
@@ -209,6 +209,20 @@
t.eq( bounds.top, 4, "bounds.top is set correctly" );
}
function test_14_Bounds_fromSize(t) {
t.plan( 5 );
var height = 15;
var width = 16;
var size = new OpenLayers.Size(width, height);
bounds = OpenLayers.Bounds.fromSize(size);
t.ok( bounds instanceof OpenLayers.Bounds, "new OpenLayers.Bounds returns Bounds object" );
t.eq( bounds.left, 0, "bounds.left is set correctly" );
t.eq( bounds.bottom, height, "bounds.bottom is set correctly" );
t.eq( bounds.right, width, "bounds.right is set correctly" );
t.eq( bounds.top, 0, "bounds.top is set correctly" );
}
// -->
</script>
</head>