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: sentry-compose/api/android/sentry-compose.api
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -6,6 +6,10 @@ public final class io/sentry/compose/BuildConfig {
6
6
public fun <init> ()V
7
7
}
8
8
9
+
public final class io/sentry/compose/SentryComposeHelperKt {
10
+
public static final fun boundsInWindow (Landroidx/compose/ui/layout/LayoutCoordinates;Landroidx/compose/ui/layout/LayoutCoordinates;)Landroidx/compose/ui/geometry/Rect;
11
+
}
12
+
9
13
public final class io/sentry/compose/SentryComposeTracingKt {
10
14
public static final fun SentryTraced (Ljava/lang/String;Landroidx/compose/ui/Modifier;ZLkotlin/jvm/functions/Function3;Landroidx/compose/runtime/Composer;II)V
11
15
}
@@ -34,11 +38,7 @@ public final class io/sentry/compose/gestures/ComposeGestureTargetLocator$Compan
34
38
35
39
public final class io/sentry/compose/viewhierarchy/ComposeViewHierarchyExporter : io/sentry/internal/viewhierarchy/ViewHierarchyExporter {
36
40
public static final field $stable I
37
-
public static final field Companion Lio/sentry/compose/viewhierarchy/ComposeViewHierarchyExporter$Companion;
38
41
public fun <init> (Lio/sentry/ILogger;)V
39
42
public fun export (Lio/sentry/protocol/ViewHierarchyNode;Ljava/lang/Object;)Z
40
43
}
41
44
42
-
public final class io/sentry/compose/viewhierarchy/ComposeViewHierarchyExporter$Companion {
logger.log(SentryLevel.WARNING, "Could not fetch position for LayoutNode", e)
69
-
}
70
-
}
71
-
returnnull
72
-
}
73
-
74
60
companionobject {
75
61
privatefunloadField(
76
62
logger:ILogger,
@@ -89,3 +75,90 @@ internal class SentryComposeHelper(private val logger: ILogger) {
89
75
}
90
76
}
91
77
}
78
+
79
+
80
+
/**
81
+
* Copied from sentry-android-replay/src/main/java/io/sentry/android/replay/util/Nodes.kt
82
+
*
83
+
* A faster copy of https://github.com/androidx/androidx/blob/fc7df0dd68466ac3bb16b1c79b7a73dd0bfdd4c1/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/layout/LayoutCoordinates.kt#L187
84
+
*
85
+
* Since we traverse the tree from the root, we don't need to find it again from the leaf node and
86
+
* just pass it as an argument.
87
+
*
88
+
* @return boundaries of this layout relative to the window's origin.
89
+
*/
90
+
publicfun LayoutCoordinates.boundsInWindow(rootCoordinates:LayoutCoordinates?): Rect {
91
+
val root = rootCoordinates ?: findRootCoordinates()
92
+
93
+
val rootWidth = root.size.width.toFloat()
94
+
val rootHeight = root.size.height.toFloat()
95
+
96
+
val bounds = root.localBoundingBoxOf(this)
97
+
val boundsLeft = bounds.left.fastCoerceIn(0f, rootWidth)
98
+
val boundsTop = bounds.top.fastCoerceIn(0f, rootHeight)
99
+
val boundsRight = bounds.right.fastCoerceIn(0f, rootWidth)
100
+
val boundsBottom = bounds.bottom.fastCoerceIn(0f, rootHeight)
101
+
102
+
if (boundsLeft == boundsRight || boundsTop == boundsBottom) {
103
+
returnRect.Zero
104
+
}
105
+
106
+
val topLeft = root.localToWindow(Offset(boundsLeft, boundsTop))
107
+
val topRight = root.localToWindow(Offset(boundsRight, boundsTop))
108
+
val bottomRight = root.localToWindow(Offset(boundsRight, boundsBottom))
109
+
val bottomLeft = root.localToWindow(Offset(boundsLeft, boundsBottom))
110
+
111
+
val topLeftX = topLeft.x
112
+
val topRightX = topRight.x
113
+
val bottomLeftX = bottomLeft.x
114
+
val bottomRightX = bottomRight.x
115
+
116
+
val left = fastMinOf(topLeftX, topRightX, bottomLeftX, bottomRightX)
117
+
val right = fastMaxOf(topLeftX, topRightX, bottomLeftX, bottomRightX)
118
+
119
+
val topLeftY = topLeft.y
120
+
val topRightY = topRight.y
121
+
val bottomLeftY = bottomLeft.y
122
+
val bottomRightY = bottomRight.y
123
+
124
+
val top = fastMinOf(topLeftY, topRightY, bottomLeftY, bottomRightY)
125
+
val bottom = fastMaxOf(topLeftY, topRightY, bottomLeftY, bottomRightY)
126
+
127
+
returnRect(left, top, right, bottom)
128
+
}
129
+
130
+
/**
131
+
* Returns the smaller of the given values. If any value is NaN, returns NaN. Preferred over
132
+
* `kotlin.comparisons.minOf()` for 4 arguments as it avoids allocating an array because of the
0 commit comments