Fix authored zero insets in absolute stack positioning (iOS) - #39
Merged
Conversation
The placeAbsolute convention read a raw zero as "unset", so an authored `bottom-0` / `right-0` was indistinguishable from no anchor at all and the child fell back to the default edge. Encode authored zeros as IEEE -0.0 on the wire and treat "non-zero OR negative sign bit" as set: `bottom-0` now anchors to the bottom edge, negatives still overhang (`-right-8` bleed), and unset edges keep the default.
Mirrors the iOS signed-zero convention: -0.0f flags an authored `right-0`/`bottom-0` (raw sign bit, since -0.0f == 0f in Kotlin), and left/top take precedence when both opposing edges are authored. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
placeAbsoluteread a raw zero inset as "unset", so an authoredbottom-0/right-0was indistinguishable from no anchor at all — the child silently fell back to the default edge instead of anchoring.Fix: authored zeros arrive as IEEE
-0.0, and the renderer treats "non-zero OR negative sign bit" as set.bottom-0anchors to the bottom edge, negatives still deliberately overhang (-right-8bleed), unset edges keep the default.