Reputation: 28252
I am faced with a dilemma. I am writing components with nested components. What sort of coordinate system scheme should I implement? I want to be able to pass points to the components without having to worry about where the origin is in absolute terms. At the same time, I want to have some sort of encapsulation when it comes to origins and stuff.
Is there any sort of guideline to follow when it comes to nested components and such?
Upvotes: 0
Views: 87
Reputation: 701
If I understand your question correctly you want to place a component in a sub-component in flex:
A point in Flex can be converted both to and from local ( in a sub component/ child ) via the globalToLocal and localToGlobal. While it by experience takes some fiddling to get it to work, it is possible. Issues can be with padding of components.
The guideline when it comes to nested components, is that you should try to minimize the nest-levels, as the layout engine suffers under deep nesting, because the layout mechanism is recursing..
Upvotes: 1