Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix inconsistency in margin application between ComposeUiBox and ViewBox #2478

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Changed:
- Nothing yet!

Fixed:
- Nothing yet!
- Fix inconsistency in margin application between `ComposeUiBox` and `ViewBox`.


## [0.16.0] - 2024-11-19
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,9 @@ internal class ComposeUiBox(
} else {
modifier.wrapContentHeight(Alignment.Top, unbounded = true)
}
if (backgroundColor != 0) {
modifier = modifier.background(Color(backgroundColor))
}
modifier = margin.let { margin ->
modifier.padding(
start = margin.start.toDp(),
Expand All @@ -158,9 +161,6 @@ internal class ComposeUiBox(
bottom = margin.bottom.toDp(),
)
}
if (backgroundColor != 0) {
modifier = modifier.background(Color(backgroundColor))
}
return modifier
}

Expand Down
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test is still pretty fucked, but the other one now matches 👍

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I'm gonna try and fix this one next. Side note, I think #2464 broke emoji search for views.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep #2476

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.