My take is that this is a good idea we should use for our whole kernel.  We 
have a few places in the DHTML kernel where we already have to set up a 
callback to let layout take place before measuring because most DHTML engines 
defer any layout from happening until the current synchronous thread ends.  It 
would be nice if we could generalize this mechanism across the kernel.

On 2010-07-10, at 10:15, Henry Minsky wrote:

> The skeleton code for the TextField-compatible object that I'm using from
> the flex sdk has a model that it uses of deferring
> re-composing a text field when you change various attributes.
> It works by calling Stage.invalidate() , and  setting a callback on a RENDER
> event that  comes back when
> the next Flash frame is being drawn.
> 
> This helps to bunch up changes for efficiency so that if you for example set
> the width and height and some other params on
> a text field, it doesn't get re-drawn N times.
> 
> I'm interested in using this mechanism for the new TextField class, but am
> wondering if it's going to cause too much
> incompatibility.  The  call to __setFormat in LzTextSprite would need to
> work a little differently for the new TextField,
> because it would need to set a callback for after the next RENDER, in order
> to get new size measurements.
> 
> I'm not sure if there's anything else in LzText that depends on making a
> change to the text sprite and then querying it
> for metrics or something immediately after.
> 
> 
> 
> -- 
> Henry Minsky
> Software Architect
> [email protected]


Reply via email to