Skip to content

Commit

Permalink
Merge pull request #889 from ecomfe/fix-svg-pattern
Browse files Browse the repository at this point in the history
fix(svg): fix shared vnode in pattern brings render issue
  • Loading branch information
pissang authored Feb 9, 2022
2 parents 43eb093 + 1ad0202 commit e25b110
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/svg/graphic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import mapStyleToAttrs from './mapStyleToAttrs';
import { SVGVNodeAttrs, createVNode, SVGVNode, vNodeToString, BrushScope } from './core';
import { MatrixArray } from '../core/matrix';
import Displayable from '../graphic/Displayable';
import { assert, isFunction, isString, logError, map, retrieve2 } from '../core/util';
import { assert, clone, isFunction, isString, logError, map, retrieve2 } from '../core/util';
import Polyline from '../graphic/shape/Polyline';
import Polygon from '../graphic/shape/Polygon';
import { GradientObject } from '../graphic/Gradient';
Expand Down Expand Up @@ -538,7 +538,7 @@ function setPattern(
}
else if (val.svgElement) { // Only string supported in SSR.
// TODO it's not so good to use textContent as innerHTML
child = val.svgElement;
child = clone(val.svgElement);
patternAttrs.width = val.svgWidth;
patternAttrs.height = val.svgHeight;
}
Expand Down

0 comments on commit e25b110

Please sign in to comment.