-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Properly measure Box children (#2398)
The Kotlin syntax I was using was not working. I can't say why. Closes: #2394
- Loading branch information
1 parent
5345799
commit 231b244
Showing
8 changed files
with
63 additions
and
7 deletions.
There are no files selected for viewing
This file contains 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
3 changes: 3 additions & 0 deletions
3
....cash.redwood.layout.composeui_ComposeUiBoxTest_RTL_testChildExplicitHeight.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
.../app.cash.redwood.layout.composeui_ComposeUiBoxTest_testChildExplicitHeight.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
3 changes: 3 additions & 0 deletions
3
...LayoutUIViewTests/__Snapshots__/UIViewBoxTestHost/testChildExplicitHeight.1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -341,14 +341,22 @@ internal fun CGSizeMake( | |
|
||
/** Returns the smallest size that wraps both [a] and [b]. */ | ||
internal fun maxEachDimension(a: CValue<CGSize>, b: CValue<CGSize>): CValue<CGSize> { | ||
return [email protected] { | ||
[email protected] { | ||
CGSizeMake( | ||
maxOf(a@width, b@width), | ||
maxOf(a@height, b@height), | ||
) | ||
} | ||
val aWidth: CGFloat | ||
val aHeight: CGFloat | ||
a.useContents { | ||
aWidth = width | ||
aHeight = height | ||
} | ||
val bWidth: CGFloat | ||
val bHeight: CGFloat | ||
b.useContents { | ||
bWidth = width | ||
bHeight = height | ||
} | ||
return CGSizeMake( | ||
maxOf(aWidth, bWidth), | ||
maxOf(aHeight, bHeight), | ||
) | ||
} | ||
|
||
/** Returns a margin that uses the largest of [a] and [b] for each side. */ | ||
|
3 changes: 3 additions & 0 deletions
3
...images/app.cash.redwood.layout.view_ViewBoxTest_RTL_testChildExplicitHeight.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
...ots/images/app.cash.redwood.layout.view_ViewBoxTest_testChildExplicitHeight.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.