mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-06-05 07:59:28 +00:00
During a LayoutAnimation.spring animation it's possible for the SvgView to have negative layout dimensions when used with 100% width/height. Check for negative dimensions before calling Bitmap.createBitmap.
This commit is contained in:
@@ -234,7 +234,7 @@ public class SvgView extends ReactViewGroup implements ReactCompoundView, ReactC
|
||||
height = (float) PropHelper.fromRelative(mbbHeight, parentHeight, 0, mScale, 12);
|
||||
setMeasuredDimension((int)Math.ceil(width), (int)Math.ceil(height));
|
||||
}
|
||||
if (width == 0 || height == 0) {
|
||||
if (width <= 0 || height <= 0) {
|
||||
return null;
|
||||
}
|
||||
Bitmap bitmap = Bitmap.createBitmap(
|
||||
|
||||
Reference in New Issue
Block a user