Skip to main content
Known Participant
July 3, 2009
Question

Content Bound and controllers problem

  • July 3, 2009
  • 1 reply
  • 784 views

Hi,


I have a textFlow with multiples ContainerController. I need to get the height of each controllers.
If I have just one controller, no problem : controller.getContentBounds() return the good Rectangle.

But, if i have much controllers, the getContentBounds method not return the good height of the LAST controller.

It’s a bug ? There is other rules to get the real height of each controllers ?

Regards
fabien

This topic has been closed for replies.

1 reply

Participating Frequently
July 3, 2009

Hi Fabien,

For performance reasons, TLF only composes as much text as it needs to display. If you have text that overflows the last container, the bounds returned by getContentBounds are estimated values, not actual values. If you need the actual values, you can force TLF to compose the entire text by calling IFlowComposer.composeToPosition() [this is equivalent to IFlowComposer.composeToPosition(0), which forces composition to the end of the flow].

Out of curiosity, by what % are the estimated values off in your case?

Abhishek

(Adobe Systems Inc.)

Known Participant
July 3, 2009

Thank you very much for your quick response!

I have no problem now.

The percentage of error of height is quite variable depending on the number of controllers in my application. Overall, I think the margin of error is between 1 to 5%. Very little, but I really need the real height!

Thank you for your brilliant framework and your responsiveness.

(and sorry for my approximative english)


best regards