@@ -107,36 +107,40 @@ public data class BorderRadiusStyle(
107107 width : Float ,
108108 height : Float ,
109109 ): ComputedBorderRadius {
110- val topLeft: LengthPercentage ? = startStart ? : topStart ? : topLeft ? : uniform
111- val topRight: LengthPercentage ? = endStart ? : topEnd ? : topRight ? : uniform
112- val bottomLeft: LengthPercentage ? = startEnd ? : bottomStart ? : bottomLeft ? : uniform
113- val bottomRight: LengthPercentage ? = endEnd ? : bottomEnd ? : bottomRight ? : uniform
114-
115110 return when (layoutDirection) {
116111 LayoutDirection .LTR ->
117112 ComputedBorderRadius (
118- topLeft = topLeft?.resolve(width, height) ? : 0f ,
119- topRight = topRight?.resolve(width, height) ? : 0f ,
120- bottomLeft = bottomLeft?.resolve(width, height) ? : 0f ,
121- bottomRight = bottomRight?.resolve(width, height) ? : 0f ,
113+ topLeft =
114+ (startStart ? : topStart ? : topLeft ? : uniform)?.resolve(width, height) ? : 0f ,
115+ topRight = (endStart ? : topEnd ? : topRight ? : uniform)?.resolve(width, height) ? : 0f ,
116+ bottomLeft =
117+ (startEnd ? : bottomStart ? : bottomLeft ? : uniform)?.resolve(width, height) ? : 0f ,
118+ bottomRight =
119+ (endEnd ? : bottomEnd ? : bottomRight ? : uniform)?.resolve(width, height) ? : 0f ,
122120 )
123121 LayoutDirection .RTL ->
124122 if (I18nUtil .instance.doLeftAndRightSwapInRTL(context)) {
125123 ComputedBorderRadius (
126- topLeft = topRight?.resolve(width, height) ? : 0f ,
127- topRight = topLeft?.resolve(width, height) ? : 0f ,
128- bottomLeft = bottomRight?.resolve(width, height) ? : 0f ,
129- bottomRight = bottomLeft?.resolve(width, height) ? : 0f ,
124+ topLeft = (endStart ? : topEnd ? : topRight ? : uniform)?.resolve(width, height) ? : 0f ,
125+ topRight =
126+ (startStart ? : topStart ? : topLeft ? : uniform)?.resolve(width, height) ? : 0f ,
127+ bottomLeft =
128+ (endEnd ? : bottomStart ? : bottomRight ? : uniform)?.resolve(width, height) ? : 0f ,
129+ bottomRight =
130+ (startEnd ? : bottomEnd ? : bottomLeft ? : uniform)?.resolve(width, height) ? : 0f ,
130131 )
131132 } else {
132133 ComputedBorderRadius (
133- topLeft = topRight?.resolve(width, height) ? : 0f ,
134- topRight = topLeft?.resolve(width, height) ? : 0f ,
135- bottomLeft = bottomRight?.resolve(width, height) ? : 0f ,
136- bottomRight = bottomLeft?.resolve(width, height) ? : 0f ,
134+ topLeft = (endStart ? : topEnd ? : topLeft ? : uniform)?.resolve(width, height) ? : 0f ,
135+ topRight =
136+ (startStart ? : topStart ? : topRight ? : uniform)?.resolve(width, height) ? : 0f ,
137+ bottomLeft =
138+ (endEnd ? : bottomStart ? : bottomLeft ? : uniform)?.resolve(width, height) ? : 0f ,
139+ bottomRight =
140+ (startEnd ? : bottomEnd ? : bottomRight ? : uniform)?.resolve(width, height) ? : 0f ,
137141 )
138142 }
139- else -> throw IllegalArgumentException (" Expected resolved layout direction" )
143+ else -> throw IllegalArgumentException (" Expected?. resolved layout direction" )
140144 }
141145 }
142146}
0 commit comments