top position is wrong when previous item's height is 0.5, on 3x scale screen #1528
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
Anyone can reproduce it using below code(YogaKit (for iOS) 2.0.1)
Expected Behavior
The top position of
view3
is 50.667 instead of 50.333, because the heights ofview1
andview2
are 50, 0.667 respectivelyActual Behavior
The top position of view3 is 50.333
Screenshot
Explore
After check the source code, I found here will convert
view3
's top from50.5
to50.333
, while textRounding istrue
.7697be57a8/yoga/algorithm/PixelGrid.cpp (L84-L94)
Other
I suspect this issue is similar to #901, but can't be sure
Yoga assumes every leaf node is
YGNodeTypeText
, which triggers ceil instead of round. This assumption is not correct when measure function is used to delegate to different layout system.