Text measurement in UIComponent
I’m building a TLF-based component that extends UIComponent in Flex 3.3.
I basically want the component to have the same behavior of am mx:Text component, where the size of the component is whatever the size of the content in the textFlow is (unless an explicitHeight or percentHeight is set).
So in my component I’m calling the setComposition size and updateAllControllers in the updateDisplayList method once I’ve got the unscaledWidth/Height. But what I really want to do is measure the height of the text in measure() and set the measuredHeight there. At the moment I’m doing two passes on updateDisplayList – firstly to set the initial composition size, then going back to measure to set measuredHeight once I can access the getContentBounds() of the composition.
Question is, is there a better way to measure the content before getting to updateDisplayList?
