diff options
| author | 2023-10-18 13:58:32 +0000 | |
|---|---|---|
| committer | 2023-10-18 13:58:32 +0000 | |
| commit | 7af4d08b2c73a8f23bbb320a033d0ab0d08e260e (patch) | |
| tree | 8596f85c064a6ec3aff53a1d52427d1fdedea240 | |
| parent | 5803d8acf032e4793e4ae0f783a66bb13d75a7a7 (diff) | |
| parent | 8bc6d805b52142ed918e578b9c6e6b64dabd0002 (diff) | |
Merge "Fix size caching bug in (Horizontal|Vertical)Grid" into main
| -rw-r--r-- | packages/SystemUI/compose/scene/src/com/android/compose/grid/Grids.kt | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/packages/SystemUI/compose/scene/src/com/android/compose/grid/Grids.kt b/packages/SystemUI/compose/scene/src/com/android/compose/grid/Grids.kt index 27f0948d5377..790665aebe3e 100644 --- a/packages/SystemUI/compose/scene/src/com/android/compose/grid/Grids.kt +++ b/packages/SystemUI/compose/scene/src/com/android/compose/grid/Grids.kt @@ -116,9 +116,14 @@ private fun Grid( if (sizeCache.rowHeights.size != rows) { sizeCache.rowHeights = IntArray(rows) { 0 } + } else { + repeat(rows) { i -> sizeCache.rowHeights[i] = 0 } } + if (sizeCache.columnWidths.size != columns) { sizeCache.columnWidths = IntArray(columns) { 0 } + } else { + repeat(columns) { i -> sizeCache.columnWidths[i] = 0 } } val totalHorizontalSpacingBetweenChildren = |