@@ -3,7 +3,7 @@ import { svgElem, styleAttrs, segmentToD, convertPathToNode } from './_utils';
33import { DEFAULT_PRECISION } from './_constants' ;
44
55export default class GradientPath {
6- constructor ( { path, segments, samples, precision = DEFAULT_PRECISION , removeChild = false } ) {
6+ constructor ( { path, segments, samples, precision = DEFAULT_PRECISION } ) {
77 // If the path being passed isn't a DOM node already, make it one
88 this . path = convertPathToNode ( path ) ;
99
@@ -42,8 +42,7 @@ export default class GradientPath {
4242 this . svg . appendChild ( this . group ) ;
4343
4444 // Remove the main path once we have the data values
45- if ( removeChild ) {
46- this . path . parentNode . removeChild ( this . path ) } ;
45+ this . path . parentNode . removeChild ( this . path ) ;
4746 }
4847
4948 render ( { type, stroke, strokeWidth, fill, width } ) {
@@ -53,6 +52,8 @@ export default class GradientPath {
5352 // Create a group for each element
5453 const elemGroup = svgElem ( 'g' , { class : `element-${ type } ` } ) ;
5554
55+ this . group . innerHTML = "" ;
56+
5657 this . group . appendChild ( elemGroup ) ;
5758 renderCycle . group = elemGroup ;
5859
0 commit comments