@@ -7,8 +7,6 @@ import kotlin.jvm.JvmInline
77
88private const val Infinity = 0xFFFF
99
10- private const val MaxSize = Infinity
11-
1210private const val MainAxisMinSizeBitOffset = 48
1311private const val MainAxisMaxSizeBitOffset = 32
1412private const val CrossAxisMinSizeBitOffset = 16
@@ -66,8 +64,8 @@ private fun packOrientationIndependentConstraints(
6664 " minSize must be less than or equal to maxSize"
6765 }
6866
69- require(mainAxisMaxSizeValue <= MaxSize && crossAxisMaxSizeValue <= MaxSize ) {
70- " size must be less than $MaxSize "
67+ require(mainAxisMaxSizeValue < Infinity && crossAxisMaxSizeValue < Infinity ) {
68+ " size must be less than $Infinity "
7169 }
7270
7371 // Pack 4 integer sizes into 64 bits.
@@ -99,7 +97,7 @@ private fun packOrientationIndependentConstraints(
9997 * If the constraints instance is created frequently, it can cause GC pressure and laggy frame.
10098 * For inlining this constraints representation, this class uses a single [Long] to pack and
10199 * represent the four integer sizes: [mainAxisMinSize], [mainAxisMaxSize], [crossAxisMinSize], and
102- * [crossAxisMaxSize]. Each size is allocated 16 bits, allowing a maximum value of 65534 (2^16 - 1)
100+ * [crossAxisMaxSize]. Each size is allocated 16 bits, allowing a maximum value of 65534
103101 * for each individual constraint component. 65535 is used to represent infinity.
104102 */
105103@Immutable
0 commit comments