Skip to content

Commit 68c325f

Browse files
committed
fix(skia): transparent fill not work
1 parent 7d2a168 commit 68c325f

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/SVGCore.ts

+9-3
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,15 @@ export function vNodeToString(
5050
const S = opts.newline ? '\n' : '';
5151
function convertElToString(el: SVGVNode): string {
5252
const { children, tag, attrs } = el;
53-
// fix: https://github.com/Shopify/react-native-skia/issues/888
54-
if (attrs['stroke-width'] === 0) {
55-
attrs['stroke-opacity'] = 0;
53+
if (tag === 'path') {
54+
// fix: https://github.com/Shopify/react-native-skia/issues/888
55+
if (attrs['stroke-width'] === 0) {
56+
attrs['stroke-opacity'] = 0;
57+
}
58+
// fix: https://github.com/wuba/react-native-echarts/issues/161
59+
if (attrs['fill'] === 'transparent') {
60+
attrs['fill-opacity'] = 0;
61+
}
5662
}
5763
if (tag === 'text') {
5864
if (typeof attrs.style === 'string') {

0 commit comments

Comments
 (0)