Skip to content

Conversation

mbrgm
Copy link
Contributor

@mbrgm mbrgm commented Feb 17, 2015

The child node needs to know its parent's absolute position in order to
determine its own absolute position. Previously, the parent's relative position
(in relation to its own parent) has been passed. This leads to wrong
positioning of nested nodes after several levels of recursion. I fixed this by
passing the current node's absolute position to the child nodes' layout
function.

The child node needs to know its parent's absolute position in order to
determine its own absolute position. Previously, the parent's relative position
(in relation to its own parent) has been passed. This leads to wrong
positioning of nested nodes after several levels of recursion. I fixed this by
passing the current node's absolute position to the child nodes' layout
function.
@mjohnston
Copy link

Looks like a good fix. If you don't mind, could you take a second to fill out the CLA and I can pull this in.

The css-layout stuff is not really baked. It has perf issues and doesn't support text flow. Not sure if you're up for it or not, but PRs in this area are welcome :)

@mbrgm
Copy link
Contributor Author

mbrgm commented Feb 17, 2015

Done. What would be an alternative to css-layout? I like the intent of it quite well.

@mjohnston
Copy link

Alternative (which is what we use on flipboard.com) is to absolutely position everything. This is the default behavior if you don't specify enableCSSLayout on the root Surface. It works out ok for us since our layouts are paginated, and doing multi-line truncated text regions with flexbox is not possible as far as I know.

mjohnston pushed a commit that referenced this pull request Feb 17, 2015
Fix parent position when walking child nodes
@mjohnston mjohnston merged commit f20e5e0 into Flipboard:master Feb 17, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants