You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/style/ComputedBorderRadius.kt
+40-2Lines changed: 40 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -7,21 +7,47 @@
7
7
8
8
packagecom.facebook.react.uimanager.style
9
9
10
-
/** Represents the collection of possible computed border radius style properties. */
10
+
/**
11
+
* Enum representing the computed border radius properties for each physical corner.
12
+
*
13
+
* Unlike [BorderRadiusProp] which includes logical properties, this enum only contains the four
14
+
* physical corners after layout direction resolution.
15
+
*/
11
16
publicenumclassComputedBorderRadiusProp {
17
+
/** The computed border radius for the top-left corner. */
12
18
COMPUTED_BORDER_TOP_LEFT_RADIUS,
19
+
/** The computed border radius for the top-right corner. */
13
20
COMPUTED_BORDER_TOP_RIGHT_RADIUS,
21
+
/** The computed border radius for the bottom-right corner. */
14
22
COMPUTED_BORDER_BOTTOM_RIGHT_RADIUS,
23
+
/** The computed border radius for the bottom-left corner. */
15
24
COMPUTED_BORDER_BOTTOM_LEFT_RADIUS,
16
25
}
17
26
18
-
/** Physical edge lengths (in DIPs) for a border-radius. */
27
+
/**
28
+
* Represents the resolved border radius values for all four physical corners.
29
+
*
30
+
* This data class contains the final computed [CornerRadii] values (in DIPs) after resolving
31
+
* logical properties based on layout direction and ensuring no corner overlap per CSS spec.
32
+
*
33
+
* @property topLeft The radii for the top-left corner
34
+
* @property topRight The radii for the top-right corner
35
+
* @property bottomLeft The radii for the bottom-left corner
36
+
* @property bottomRight The radii for the bottom-right corner
37
+
* @see BorderRadiusStyle
38
+
* @see CornerRadii
39
+
*/
19
40
publicdata classComputedBorderRadius(
20
41
valtopLeft:CornerRadii,
21
42
valtopRight:CornerRadii,
22
43
valbottomLeft:CornerRadii,
23
44
valbottomRight:CornerRadii,
24
45
) {
46
+
/**
47
+
* Checks if any corner has a non-zero border radius.
48
+
*
49
+
* @return true if at least one corner has a positive radius
50
+
*/
25
51
publicfunhasRoundedBorders(): Boolean {
26
52
return topLeft.horizontal >0f||
27
53
topLeft.vertical >0f||
@@ -32,10 +58,21 @@ public data class ComputedBorderRadius(
32
58
bottomRight.horizontal >0f
33
59
}
34
60
61
+
/**
62
+
* Checks if all corners have the same radius values.
0 commit comments