Hi Ratlan,
I think the stack overflow is caused by binding the width of the rectangle to the width of the group. But the width of the group is determined by the width of its children, which includes the rectangle. I don't know why it works when you comment out the Stroke line. Try setting the width to hard-coded values and putting the Stroke back in just to see what happens.
If you're trying to achieve the effect where the rectangle is the same size as the stage/scene, then you should bind the rectangle width to scene.width.
Re: Setting stroke on Rectangle: StackOverflowError
Jan 16, 2009 1:37 PM
(reply 2
of 2) (In reply to
#1 )
Helpful
Good catch stemkev.
I think I know why the stroke color changes the behavior: without it, the rectangle is exactly of the size of the Group, so no positive feed-back inducing the (almost) infinite loop. By specifying a color, the shape is widened by 1 pixel, 3 if strokeWidth is 2, etc. -- width seems to be around the shape frontier!