DisplayUtil.positionBounds()

git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@570 ed5b42cb-e716-0410-a449-f6a68f950b19
This commit is contained in:
Tom Conkling
2008-07-11 22:00:19 +00:00
parent 5a0b164c3f
commit d2c253af72
@@ -31,6 +31,17 @@ import flash.geom.Rectangle;
public class DisplayUtil
{
/**
* Sets the top-left pixel of a DisplayObject to the given location, taking the
* object's bounds into account.
*/
public static function positionBounds (disp :DisplayObject, x :Number, y :Number) :void
{
var bounds :Rectangle = disp.getBounds(disp);
disp.x = x - bounds.left;
disp.y = y - bounds.top;
}
/**
* Sorts a container's children, using ArrayUtil.stableSort.
*