Inconsistency in handling width and height for rotated components

I’ve been recently working on a component that contained rotated label in it and I discovered that using width and height attributes (MXML) in such case might result in unexpected behaviour.

The problem occurs when you start using absolute values for these properties. If for example you set height to be 100% then actual height of the component will be influenced. However if you set height to be 500, width of the component will be changed instead.

It turns out, that percent size (which is calculated relative to parent and post-transform) would take component’s rotation into account while explicit size is calculated pre-transform (which is a change in Flex 4). While it is all working according to specification trying to use “proxy setters” like width/height might cause some confusion.

You can use this little app to try it.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: