Commit 7fbdc4c
authored
fix: Fix compose coordinate offset. (#331)
- Fix compose coordinate offset.
- Fix crash if unsuccessful kind of view was sent to draw into canvas
<img width="725" height="585" alt="image"
src="https://github.com/user-attachments/assets/070420ed-69b9-4c6a-b76b-4c4b69489f8e"
/>
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Fixes Compose mask polygon coordinates and avoids crashes by safely
handling Canvas draw failures during capture.
>
> - **Masking (Compose)**:
> - Correct coordinate calculation for polygons by using
`localToScreen(...)` points directly (remove root offset adjustment) in
`ComposeMaskTarget.points`.
> - **Capture**:
> - Make `canvasDraw` return `Bitmap?` and wrap `view.draw` in try/catch
to prevent crashes; recycle bitmap on failure.
> - Log window capture/draw failures with `warn` level in
`CaptureSource`.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
a7cbe59. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent ed2b645 commit 7fbdc4c
File tree
2 files changed
+21
-10
lines changed- sdk/@launchdarkly/observability-android/lib/src/main/kotlin/com/launchdarkly/observability/replay
- capture
- masking
2 files changed
+21
-10
lines changedLines changed: 21 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
200 | 200 | | |
201 | 201 | | |
202 | 202 | | |
203 | | - | |
| 203 | + | |
204 | 204 | | |
205 | 205 | | |
206 | 206 | | |
| |||
220 | 220 | | |
221 | 221 | | |
222 | 222 | | |
223 | | - | |
| 223 | + | |
224 | 224 | | |
225 | 225 | | |
226 | 226 | | |
227 | 227 | | |
228 | 228 | | |
229 | 229 | | |
230 | 230 | | |
231 | | - | |
232 | | - | |
| 231 | + | |
| 232 | + | |
233 | 233 | | |
234 | 234 | | |
235 | | - | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
236 | 242 | | |
237 | 243 | | |
238 | 244 | | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
239 | 255 | | |
240 | 256 | | |
241 | 257 | | |
| |||
Lines changed: 0 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
135 | 135 | | |
136 | 136 | | |
137 | 137 | | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | 138 | | |
144 | 139 | | |
145 | 140 | | |
| |||
0 commit comments