开发者

How can I keep track of all the changes of coordinate system origin when writing components?

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 pas开发者_Python百科s 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?


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..

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜