Skip to content

Commit 0969347

Browse files
authored
Merge pull request #1096 from ecomfe/fix-path
fix(path): using appendData instead of setData for path
2 parents 247e119 + 55b9232 commit 0969347

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/core/PathProxy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ export default class PathProxy {
389389
for (let i = 0; i < len; i++) {
390390
appendSize += path[i].len();
391391
}
392-
if (hasTypedArray && (this.data instanceof Float32Array)) {
392+
if (hasTypedArray && (this.data instanceof Float32Array || !this.data)) {
393393
this.data = new Float32Array(offset + appendSize);
394394
}
395395
for (let i = 0; i < len; i++) {

src/tool/path.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ function createPathOptions(str: string, opts: SVGPathOption): InnerSVGPathOption
389389
const innerOpts: InnerSVGPathOption = extend({}, opts);
390390
innerOpts.buildPath = function (path: PathProxy | CanvasRenderingContext2D) {
391391
if (isPathProxy(path)) {
392-
path.setData(pathProxy.data);
392+
path.appendPath(pathProxy);
393393
// Svg and vml renderer don't have context
394394
const ctx = path.getContext();
395395
if (ctx) {

0 commit comments

Comments
 (0)