@@ -27,6 +27,7 @@ import io.sentry.android.replay.util.findPainter
2727import io.sentry.android.replay.util.findTextColor
2828import io.sentry.android.replay.util.isMaskable
2929import io.sentry.android.replay.util.toOpaque
30+ import io.sentry.android.replay.util.toRect
3031import io.sentry.android.replay.viewhierarchy.ViewHierarchyNode.GenericViewHierarchyNode
3132import io.sentry.android.replay.viewhierarchy.ViewHierarchyNode.ImageViewHierarchyNode
3233import io.sentry.android.replay.viewhierarchy.ViewHierarchyNode.TextViewHierarchyNode
@@ -150,8 +151,8 @@ internal object ComposeViewHierarchyNode {
150151 // If we're unable to retrieve the semantics configuration
151152 // we should play safe and mask the whole node.
152153 return GenericViewHierarchyNode (
153- x = visibleRect.left.toFloat() ,
154- y = visibleRect.top.toFloat() ,
154+ x = visibleRect.left,
155+ y = visibleRect.top,
155156 width = node.width,
156157 height = node.height,
157158 elevation = (parent?.elevation ? : 0f ),
@@ -161,17 +162,17 @@ internal object ComposeViewHierarchyNode {
161162 isImportantForContentCapture = false , // will be set by children
162163 isVisible =
163164 ! SentryLayoutNodeHelper .isTransparent(node) &&
164- visibleRect.height() > 0 &&
165- visibleRect.width() > 0 ,
166- visibleRect = visibleRect,
165+ visibleRect.height > 0 &&
166+ visibleRect.width > 0 ,
167+ visibleRect = visibleRect.toRect() ,
167168 )
168169 }
169170
170171 val isVisible =
171172 ! SentryLayoutNodeHelper .isTransparent(node) &&
172173 (semantics == null || ! semantics.contains(SemanticsProperties .InvisibleToUser )) &&
173- visibleRect.height() > 0 &&
174- visibleRect.width() > 0
174+ visibleRect.height > 0 &&
175+ visibleRect.width > 0
175176 val isEditable =
176177 semantics?.contains(SemanticsActions .SetText ) == true ||
177178 semantics?.contains(SemanticsProperties .EditableText ) == true
@@ -206,8 +207,8 @@ internal object ComposeViewHierarchyNode {
206207 null
207208 },
208209 dominantColor = textColor?.toArgb()?.toOpaque(),
209- x = visibleRect.left.toFloat() ,
210- y = visibleRect.top.toFloat() ,
210+ x = visibleRect.left,
211+ y = visibleRect.top,
211212 width = node.width,
212213 height = node.height,
213214 elevation = (parent?.elevation ? : 0f ),
@@ -216,7 +217,7 @@ internal object ComposeViewHierarchyNode {
216217 shouldMask = shouldMask,
217218 isImportantForContentCapture = true ,
218219 isVisible = isVisible,
219- visibleRect = visibleRect,
220+ visibleRect = visibleRect.toRect() ,
220221 )
221222 }
222223 else -> {
@@ -226,8 +227,8 @@ internal object ComposeViewHierarchyNode {
226227
227228 parent?.setImportantForCaptureToAncestors(true )
228229 ImageViewHierarchyNode (
229- x = visibleRect.left.toFloat() ,
230- y = visibleRect.top.toFloat() ,
230+ x = visibleRect.left,
231+ y = visibleRect.top,
231232 width = node.width,
232233 height = node.height,
233234 elevation = (parent?.elevation ? : 0f ),
@@ -236,7 +237,7 @@ internal object ComposeViewHierarchyNode {
236237 isVisible = isVisible,
237238 isImportantForContentCapture = true ,
238239 shouldMask = shouldMask && painter.isMaskable(),
239- visibleRect = visibleRect,
240+ visibleRect = visibleRect.toRect() ,
240241 )
241242 } else {
242243 val shouldMask = isVisible && semantics.shouldMask(isImage = false , options)
@@ -245,8 +246,8 @@ internal object ComposeViewHierarchyNode {
245246 // TODO: traverse the ViewHierarchyNode here again. For now we can recommend
246247 // TODO: using custom modifiers to obscure the entire node if it's sensitive
247248 GenericViewHierarchyNode (
248- x = visibleRect.left.toFloat() ,
249- y = visibleRect.top.toFloat() ,
249+ x = visibleRect.left,
250+ y = visibleRect.top,
250251 width = node.width,
251252 height = node.height,
252253 elevation = (parent?.elevation ? : 0f ),
@@ -255,7 +256,7 @@ internal object ComposeViewHierarchyNode {
255256 shouldMask = shouldMask,
256257 isImportantForContentCapture = false , // will be set by children
257258 isVisible = isVisible,
258- visibleRect = visibleRect,
259+ visibleRect = visibleRect.toRect() ,
259260 )
260261 }
261262 }
0 commit comments