fix: masked element layer opacity when previous item has stroke opacity (#2456)

# Summary

On Android when element before masked element has strokeOpacity
different from 1, the paint is reused to draw an offscreen layer
resulting in wrong opacity. Partially fixes (only on Android) #2449

## Test Plan

Add `stroke` and `strokeOpacity` to element directly before masked
element.

## Compatibility

| OS      | Implemented |
| ------- | :---------: |
| Android |          |
This commit is contained in:
Jakub Grzywacz
2024-09-18 13:13:59 +02:00
committed by GitHub
parent 09006498a8
commit 9049089954

View File

@@ -377,7 +377,7 @@ public abstract class RenderableView extends VirtualView implements ReactHitSlop
canvas.drawBitmap(elementBitmap, 0, 0, bitmapPaint);
canvas.restoreToCount(saveCount);
} else {
canvas.saveLayer(null, paint);
canvas.saveLayer(null, new Paint());
draw(canvas, paint, opacity);
}