Skip to content

Commit

Permalink
fix(skia): transparent fill not work
Browse files Browse the repository at this point in the history
  • Loading branch information
zhiqingchen committed Apr 26, 2024
1 parent 7d2a168 commit 68c325f
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/SVGCore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,15 @@ export function vNodeToString(
const S = opts.newline ? '\n' : '';
function convertElToString(el: SVGVNode): string {
const { children, tag, attrs } = el;
// fix: https://github.com/Shopify/react-native-skia/issues/888
if (attrs['stroke-width'] === 0) {
attrs['stroke-opacity'] = 0;
if (tag === 'path') {
// fix: https://github.com/Shopify/react-native-skia/issues/888
if (attrs['stroke-width'] === 0) {
attrs['stroke-opacity'] = 0;
}
// fix: https://github.com/wuba/react-native-echarts/issues/161
if (attrs['fill'] === 'transparent') {

Check warning on line 59 in src/SVGCore.ts

View workflow job for this annotation

GitHub Actions / lint

["fill"] is better written in dot notation
attrs['fill-opacity'] = 0;
}
}
if (tag === 'text') {
if (typeof attrs.style === 'string') {
Expand Down

0 comments on commit 68c325f

Please sign in to comment.