[Java] Outdated node layout values in custom baseline function #616
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Report
Issues and Steps to Reproduce
In custom baseline function, the
YogaNode
java object is containing old layout values (position, width, height etc.).Sample code to reproduce issue (Comments added in the custom baseline function representing log output) :
Expected Behavior
Inside custom baseline function
javaYogaNode.getLayoutX()
etc. in java side should give same values as the values obtained usingYGNodeLayoutGetLeft(node)
etc. in C sideActual Behavior
Values are different since
javaYogaNode.getLayoutX()
is returning the value ofmLeft
field inYogaNode
class. When you callcalculateLayout
, only after calculating the layout of all the nodes, layout fields are updated in java object. But in between calculation of layout, custom baseline function will be called.