Skip to content

Commit

Permalink
fix: masked element layer opacity when previous item has stroke opaci…
Browse files Browse the repository at this point in the history
…ty (#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 |    ✅      |
  • Loading branch information
jakex7 committed Sep 18, 2024
1 parent 0900649 commit 9049089
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion android/src/main/java/com/horcrux/svg/RenderableView.java
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ void render(Canvas canvas, Paint paint, float opacity) {
canvas.drawBitmap(elementBitmap, 0, 0, bitmapPaint);
canvas.restoreToCount(saveCount);
} else {
canvas.saveLayer(null, paint);
canvas.saveLayer(null, new Paint());
draw(canvas, paint, opacity);
}

Expand Down

0 comments on commit 9049089

Please sign in to comment.