diff --git a/src/svg/Painter.ts b/src/svg/Painter.ts index 27bdeeb39..6731e5c4a 100644 --- a/src/svg/Painter.ts +++ b/src/svg/Painter.ts @@ -143,7 +143,7 @@ class SVGPainter implements PainterBase { const children: SVGVNode[] = []; - const bgVNode = this._bgVNode = createBackgroundVNode(this._id, width, height, this._backgroundColor, scope); + const bgVNode = this._bgVNode = createBackgroundVNode(width, height, this._backgroundColor, scope); bgVNode && children.push(bgVNode); // Ignore the root g if wan't the output to be more tight. @@ -360,7 +360,6 @@ function createMethodNotSupport(method: string): any { } function createBackgroundVNode( - zrId: string, width: number, height: number, backgroundColor: SVGPainterBackgroundColor, @@ -375,8 +374,7 @@ function createBackgroundVNode( width, height, x: '0', - y: '0', - id: zrId + '-bg' + y: '0' } ); if (isGradient(backgroundColor)) { diff --git a/test/svg-backgroundColor.html b/test/svg-backgroundColor.html index 40e1e79a7..c6f6b08f3 100644 --- a/test/svg-backgroundColor.html +++ b/test/svg-backgroundColor.html @@ -16,9 +16,6 @@
- -

This should not have a rect with the same id as the above instance.

-