As you know, TLF is a boatload of code. I don't know how getContentBounds works, but like I said, I believe that input is reflected to the screen on the keyboard event and then later the composition pass happens. Maybe getContentBounds reflects that temporary state. If you look at RichEditableText.as, there might be code that tackles that issue.
On 3/14/13 3:36 PM, "Harbs" <[email protected]> wrote: > I was not very clearÅ ;-) > > I'm setting the size of the containing component on an updateComplete event > using controller.getContentBounds() > > The content bounds seems to be larger than what I specified as the > compositionWidth. In my thinking, that should not be happening. Of course, I > can check the composed width and force it back down on a compositionComplete > event (I think), but I would not have thought I should have to do thatÅ > > Here's a bit of code to make it clearer: > > private function onUpdate(ev:UpdateCompleteEvent):void{ > var bounds:Rectangle = controller.getContentBounds(); > if(bounds.width != width || bounds.height != height){ > width = bounds.width; > height = bounds.height; > dispatchEvent(new Event(ResizeEvent.RESIZE)); > } > } > The width is wider than what I specified in > controller.setCompositionSize(value,controller.compositionHeight); > > On Mar 15, 2013, at 12:27 AM, Alex Harui wrote: > >> >> >> >> On 3/14/13 3:19 PM, "Harbs" <[email protected]> wrote: >> >>> I have a custom TLF container which sometimes has the width constrained. The >>> width sometimes expands a little beyond the constrained boundaries while >>> typing. (up to 10 pixels or so) >>> >>> It only happens on words that don't quite break. INstead of being moved to >>> the >>> next line, the container expands. Once the word breaks to the next line, the >>> container snaps back to the specified width. (I'm using Flex 4.9.0). >>> >>> Shouldn't this code cause the container to never be wider than the specified >>> width? >>> >>> controller.setCompositionSize(value,controller.compositionHeight); >> Makes sense, but if this is a Flex app, is other code changing the measured >> size? >> >> How do you know the container is expanding vs the textlines just overrunning >> the right edge? >> >> I think TLF has a notion of "damage" before re-composition so maybe the >> input gets reflected to the screen before there is composition. In fact, I >> think they compose on frame events instead of input events for performance >> reasons. >> >> -- >> Alex Harui >> Flex SDK Team >> Adobe Systems, Inc. >> http://blogs.adobe.com/aharui >> > -- Alex Harui Flex SDK Team Adobe Systems, Inc. http://blogs.adobe.com/aharui
