fix: mask render on android (#1981)

It seems that the bug comes from the fact that on iOS we are making a Rect from those values, which takes its starting positions and than width and height as argument, whereas on Android the arguments are strictly 4 bounds, therefore we need to add the starting points to the right and bottom argument.
This commit is contained in:
Alex Afanasenko
2023-03-24 14:25:24 +01:00
committed by GitHub
parent baf011fbf1
commit ccda91c8df
@@ -366,7 +366,7 @@ public abstract class RenderableView extends VirtualView implements ReactHitSlop
float maskY = (float) relativeOnHeight(mask.mY);
float maskWidth = (float) relativeOnWidth(mask.mW);
float maskHeight = (float) relativeOnHeight(mask.mH);
maskCanvas.clipRect(maskX, maskY, maskWidth, maskHeight);
maskCanvas.clipRect(maskX, maskY, maskWidth + maskX, maskHeight + maskY);
Paint maskPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
mask.draw(maskCanvas, maskPaint, 1);