Commit 72fc5ba
authored
fix: resolve false positives with
We changed this logic in
#245 to
workaround a specific bug for Metal-backed views. However, it returns
false positives. For example a black pixel is also seen as transparent,
because the all four (checked) bytes are `0`.
This PR actually combines the two approaches into a combined more
foolproof approach. It uses the snapshot approach to capture the pixel,
but it uses the old approach of parsing it into a pixel array.isPixelTransparent helper (#250)1 parent 83352e7 commit 72fc5ba
1 file changed
Lines changed: 33 additions & 4 deletions
Lines changed: 33 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
5 | 31 | | |
6 | 32 | | |
7 | 33 | | |
| |||
12 | 38 | | |
13 | 39 | | |
14 | 40 | | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | 41 | | |
19 | | - | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
20 | 49 | | |
21 | 50 | | |
0 commit comments