Skip to content

Commit 43383fe

Browse files
authored
Remove removeChild boolean
1 parent 1cd1c79 commit 43383fe

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "gradient-path",
3-
"version": "2.4.1",
3+
"version": "2.5.0",
44
"description": "A small library to have any gradient follow along any SVG path",
55
"main": "dist/index.js",
66
"module": "dist/index.esm.js",

src/GradientPath.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { svgElem, styleAttrs, segmentToD, convertPathToNode } from './_utils';
33
import { DEFAULT_PRECISION } from './_constants';
44

55
export 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

Comments
 (0)