Skip to content

children doesn't respect parents position #243

Answered by michalochman
kresli asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @kresli, in the way customApplyProps is implemented here, the props (e. g. x and y) are no longer passed to to PIXI, it is just using them to draw the graphics object.

See a note in README: https://github.com/michalochman/react-pixi-fiber#customapplypropsdisplayobject-oldprops-newprops-optional

You probably want to additionally call at the end of customApplyProps:

this.applyDisplayObjectProps(oldProps, newProps)

or maybe:

this.applyDisplayObjectProps({ x: oldProps.x, y: oldProps.y }, { x: newProps.x, y: newProps.y })

This will most likely require you to call drawRect at 0, 0 position instead, to only use x and y as DisplayObject position property.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by michalochman
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