Measure() should return the bound of the children factoring out
centering offsets.

 

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Josh McDonald
Sent: Thursday, June 19, 2008 7:21 PM
To: [email protected]
Subject: [flexcoders] Problems with updateDisplayList() and measure()
and infinite loops + bug in CanvasLayout?

 

Hey guys,

I've got a problem with some layout code I'm working on. I'm positioning
a bunch of components, and their positions are determined by their
measured size. However they are also being expanded larger that their
measured size on occasion, which sends me into an infinite loop whenever
one of my containers contains anything that's centred.

I've figured out that this is due to CanvasLayout.measure() measuring
children with horizontalCenter / verticalCenter at their current
position, rather than at 0,0 which would make more sense to me. Not much
I can do about this. It smells like a bug, but it might be on purpose.

What should I do to combat this problem? I was thinking maybe setting a
flag on updateDisplayList, that will make the next call to measure()
return the same size no matter what, but that seems like a hack to me.
And if there's an occasion where updateDisplayList() isn't followed
immediately by measure() it'll break, and various other things just make
it seem very frail.

Has anybody come up against this sort of thing before? How did you
tackle it?

Cheers,

-Josh

-- 
"Therefore, send not to know For whom the bell tolls. It tolls for
thee."

:: Josh 'G-Funk' McDonald
:: 0437 221 380 :: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>  

 

Reply via email to