drawOutput() only when Layout is != 0

This commit is contained in:
Quentin Valmori
2018-04-30 12:25:47 +02:00
committed by GitHub
parent 046c7efc04
commit 6a63989f73
@@ -127,13 +127,18 @@ public class SvgViewShadowNode extends LayoutShadowNode {
}
private Object drawOutput() {
Bitmap bitmap = Bitmap.createBitmap(
(int) getLayoutWidth(),
(int) getLayoutHeight(),
Bitmap.Config.ARGB_8888);
int layoutWidth = (int) getLayoutWidth();
int layoutHeight = (int) getLayoutHeight();
if(layoutHeight != 0 && layoutWidth != 0) {
Bitmap bitmap = Bitmap.createBitmap(
layoutWidth,
layoutHeight,
Bitmap.Config.ARGB_8888);
drawChildren(new Canvas(bitmap));
return bitmap;
drawChildren(new Canvas(bitmap));
return bitmap;
}
return null;
}
Rect getCanvasBounds() {