YGNodeStyleGetGap
does not account for units of gap
#1778
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?
Support for percentage gaps was recently added to Yoga. This uses a separate setter (presumably to avoid needing to add a units parameter to the existing setter), however it still has a single getting which returns a float value. This may either be a pixel value or a percentage and there is no way to tell which it is.
Suggested fix:
YGNodeStyleGetGap
to returnYGValue
This was fixed by
ae2d06d0f5
Ah yes, so it was. I've been updating Yoga's rust bindings and I decided it was probably better to go with a versioned release so I don't have that commit yet.
The mildly annoying part is that it's a breaking change, so I've been planning to make the next release Yoga 4.0 to account for that (it's also why I wanted to avoid it being part of last branch cut).
Yeah, that is annoying. If you're doing a breaking release, then you may also wish to consider renaming
YGGutter
toYGGap
(for consistency). The other things on my wishlist from an API perspective (with my Rust bindings hat on) would be setter methods that take aYGValue
(or separatefloat
andYGUnit
parameters) with some convention around what to do if an invalid unit is used (we've been implementing this as a wrapper on top of the C API in the Rust bindings).That naming around
YGGutter
was kinda intentional to avoid ambiguity with having a "gap" parameter in style setters which means row/column/all, vs the gap amount. So spec language around "gutter" is used. https://www.w3.org/TR/css-align-3/#column-row-gap