diff --git a/lib/network/modules/components/Node.js b/lib/network/modules/components/Node.js index 70eb31553e..4bbcc61bc4 100644 --- a/lib/network/modules/components/Node.js +++ b/lib/network/modules/components/Node.js @@ -564,8 +564,7 @@ class Node { this.shape = new CustomShape( this.options, this.body, - this.labelModule, - this.options.ctxRenderer + this.labelModule ); break; case "database": diff --git a/lib/network/modules/components/nodes/shapes/CustomShape.js b/lib/network/modules/components/nodes/shapes/CustomShape.js index e13b2c48fd..0ed7dc0bbc 100644 --- a/lib/network/modules/components/nodes/shapes/CustomShape.js +++ b/lib/network/modules/components/nodes/shapes/CustomShape.js @@ -12,11 +12,9 @@ class CustomShape extends ShapeBase { * @param {object} options * @param {object} body * @param {Label} labelModule - * @param {Function} ctxRenderer */ - constructor(options, body, labelModule, ctxRenderer) { - super(options, body, labelModule, ctxRenderer); - this.ctxRenderer = ctxRenderer; + constructor(options, body, labelModule) { + super(options, body, labelModule); } /** @@ -36,7 +34,7 @@ class CustomShape extends ShapeBase { // Guard right away because someone may just draw in the function itself. ctx.save(); - const drawLater = this.ctxRenderer({ + const drawLater = this.options.ctxRenderer({ ctx, id: this.options.id, x,