add offset() operation to OpenLayers.Pixel

git-svn-id: http://svn.openlayers.org/trunk/openlayers@444 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
euzuro
2006-05-29 11:48:42 +00:00
parent 0047f3e730
commit 0985ac299e
2 changed files with 26 additions and 0 deletions

View File

@@ -61,6 +61,21 @@
t.eq( pixel.y, 26, "pixel.y is set correctly");
}
function test_08_Pixel_offset(t) {
t.plan( 4 );
var oldPixel = new OpenLayers.Pixel(5,6);
var offset = new OpenLayers.Pixel(10,20);
pixel = oldPixel.offset(offset);
t.eq( oldPixel.x, 5, "oldPixel.x not modified by offset operation");
t.eq( oldPixel.y, 6, "oldPixel.y not modified by offset operation");
t.eq( pixel.x, 15, "pixel.x is set correctly");
t.eq( pixel.y, 26, "pixel.y is set correctly");
}
// -->
</script>
</head>