Skip to main content
August 5, 2011
Question

Bug in _containerController.getContentBounds() ?

  • August 5, 2011
  • 2 replies
  • 607 views

I think I might have stumbled over a bug in the code that calculates the size of the content in a textflow.
I have included a Flashbuilder 4.5 testCase project to demonstrate the problem: http://dev.webscape.no/testCase.zip

Follow these steps to recreate:

1. Fire up the TestCase project. It contains a square marking the size of the text area, and a simple button on the right.
Just click inside the square and type away. I've included a call to _containerController.getContentBounds() on all changes in the textflow giving you the height and width of the content.


2. Press the green button when you have reached about 2/3 down the bounding box. This will insert a graphics element in the textflow. The text will scroll down (I did not bother to include a scrollbar) since the graphics element is bigger than the available space in the textholder, and the cursor will be placed on the right side of the graphics, since the element is marked as float left.

3. Continue writing text to the right of the graphics element and after 2-3 lines of text watch the layout of the textflow fall apart.
If you look at the values traced from the _containerController.getContentBounds() call you'll see that the height of the content has gone from somewhere around 550px, to about 300px.

My best guess is that something strange happens when the graphics are inserted into the textflow and the flow is scrolled. It looks like the textflow falls apart when it tries to scroll further down the text.

Am I right in this being a bug?

This topic has been closed for replies.

2 replies

August 8, 2011

Yup, that worked.

I used a version downloaded via SVN from your svn://svn.code.sf.net/adobe/tlf/svn/trunk url. I think it's rev 525?

Sorry for flagging a non issue, everything works now. Thanks for the help!

August 5, 2011

A bit more info:

I have confirmed that the TextLayoutEvent.SCROLL event is sent in sync with this happening. So there is probably something wonky going on in the TextFlow scroll methods related to the size of the content.

Adobe Employee
August 8, 2011

Which version of TLF are you running with? I cannot reproduce it with our current code.

Pls download code or binary of tlf at http://sourceforge.net/projects/tlf.adobe/files/3.0/current/, which was uploaded on 21st July, and have a try yourself.