Skip to content

Commit bcc38f7

Browse files
committed
Simplify Constraints creation
1 parent 92c0744 commit bcc38f7

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

PerformanceCodelab/app/src/main/java/com/compose/performance/phases/PhasesAnimatedShape.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,12 @@ fun MyShape(size: () -> Dp, modifier: Modifier = Modifier) = trace("MyShape") {
7979
val sizePx = size()
8080
.roundToPx()
8181
.coerceAtLeast(0)
82-
val constraints = Constraints(
83-
minWidth = sizePx,
84-
maxWidth = sizePx,
85-
minHeight = sizePx,
86-
maxHeight = sizePx
82+
83+
val constraints = Constraints.fixed(
84+
width = sizePx,
85+
height = sizePx,
8786
)
87+
8888
val placeable = measurable.measure(constraints)
8989
layout(sizePx, sizePx) {
9090
placeable.place(0, 0)

0 commit comments

Comments
 (0)