@@ -107,36 +107,40 @@ public data class BorderRadiusStyle(
107
107
width : Float ,
108
108
height : Float ,
109
109
): 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
-
115
110
return when (layoutDirection) {
116
111
LayoutDirection .LTR ->
117
112
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 ,
122
120
)
123
121
LayoutDirection .RTL ->
124
122
if (I18nUtil .instance.doLeftAndRightSwapInRTL(context)) {
125
123
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 ,
130
131
)
131
132
} else {
132
133
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 ,
137
141
)
138
142
}
139
- else -> throw IllegalArgumentException (" Expected resolved layout direction" )
143
+ else -> throw IllegalArgumentException (" Expected?. resolved layout direction" )
140
144
}
141
145
}
142
146
}
0 commit comments