Skip to content

Nested node position offset #1721

Answered by bcakmakoglu
homeless2010 asked this question in Q&A
Discussion options

You must be logged in to vote

Your post is lacking a proper description again but I think I can assume what you're asking is why the position seems to behave differently than you expect.
This is due to to the behavior of position when a parentNode is used.
A node with a parentNode id will have it's position relative to the parent node. That means position: { x: 0, y: 0 } would be the top-left corner of the parent node, while a node without a parent node will position itself relative to the viewport, meaning position: { x: 0, y: 0 } would be the top-left corner of the viewport (given it has not been moved whatsoever).

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@homeless2010
Comment options

Answer selected by homeless2010
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants