Archive

Archive for December, 2013

Flex, actionscript getBounds(), getRect(), getVisibleRect() sucks !

December 20, 2013 Comments off

After playing for quite long with getBounds(), getRect(), getVisibleRect(), I ended up understanding those function suck.

In fact if you want to get the rect of a UIComponent, when this is one is supposed to be rotated, those functions will give you shit.

so here, the function I wrote, which works :
public static function getBounds( component:UIComponent ):Rectangle
{
return new Rectangle(component.getLayoutBoundsX(), component.getLayoutBoundsY(), component.getLayoutBoundsWidth(), component.getLayoutBoundsHeight() );
}

Categories: Uncategorized