mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-06-08 17:15:04 +00:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user