Much better -- in fact, I'm about to commit the changes to FlowView. I think I've caught all the bugs (I hope?).
Could I clarify one thing in the spec for this feature? I had assumed that the relative origin flag would control how the composite view's children are placed -- that is, every view placed inside a composite view would look to its parent to determine whether it should draw relative to the window or the container's origin. But that isn't the case if you put a non relative composite view inside a relative one:
w = SCWindow.new("mixed relative/absolute", Rect(10, 10, 300, 300)).front;
f = SCCompositeView(w, Rect(50, 50, 200, 200)).relativeOrigin_(true).background_(Color.red(alpha: 0.2));
g = SCCompositeView(f, Rect(20, 20, 160, 160)).relativeOrigin_(false).background_(Color.blue(alpha: 0.2));
I'm not saying the behavior should change -- the absoluteBounds method I posted yesterday doesn't handle this situation either, or to be more precise, it behaves just like the underlying views :) -- and I think the logic would get prohibitively complex to handle this differently.
In any case, it will be an important point for the documentation that if you're nesting composite views inside any relative composite view, all the inner containers must also be relative or things will not look right.
I think we're in good shape. Thanks for the great work, Jan!
On Jan 20, 2008, at 3:45 AM, Jan Trutzschler wrote:
: H. James Harkins
"Come said the Muse,
Sing me a song no poet has yet chanted,
Sing me the universal." -- Whitman