Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,16 @@ private static Paint createPaint() {
return paint;
}

private static boolean isSvgView(View view) {
try {
String className = view.getClass().getName();
return className != null && className.startsWith("com.horcrux.svg");
} catch (Throwable t) {
Log.e("ViewScreenshotService", "Error checking if view is SVG", t);
return false;
}
}

private static void renderViewToCanvas(Canvas canvas, View view, Paint paint, float parentOpacity) {
float combinedOpacity = parentOpacity * view.getAlpha();
canvas.save();
Expand All @@ -83,7 +93,7 @@ private static void renderViewToCanvas(Canvas canvas, View view, Paint paint, fl
canvas.clipRect(clipLeft, clipTop, clipRight, clipBottom);
}

if (view instanceof ViewGroup) {
if (view instanceof ViewGroup && !isSvgView(view)) {
ViewGroup group = (ViewGroup) view;
drawBackgroundIfPresent(canvas, view, combinedOpacity);
drawChildren(canvas, group, paint, combinedOpacity);
Expand Down