diff --git a/lib/forcegraph.js b/lib/forcegraph.js index 9b85e86..7b00b0e 100644 --- a/lib/forcegraph.js +++ b/lib/forcegraph.js @@ -381,7 +381,6 @@ define(["d3"], function (d3) { }) ctx.fillStyle = clientColor - ctx.globalCompositeOperation = "overlay" ctx.fill() ctx.restore() @@ -395,13 +394,12 @@ define(["d3"], function (d3) { ctx.globalCompositeOperation = "lighten" ctx.fillStyle = highlightColor + ctx.beginPath() highlightedNodes.forEach(function (d) { - ctx.beginPath() ctx.moveTo(d.x + 5 * nodeRadius, d.y) ctx.arc(d.x, d.y, 5 * nodeRadius, 0, 2 * Math.PI) - ctx.fill() - ctx.restore() }) + ctx.fill() ctx.restore() } @@ -418,12 +416,12 @@ define(["d3"], function (d3) { ctx.strokeStyle = highlightColor ctx.lineCap = "round" + ctx.beginPath() highlightedLinks.forEach(function (d) { - ctx.beginPath() ctx.moveTo(d.source.x, d.source.y) ctx.lineTo(d.target.x, d.target.y) - ctx.stroke() }) + ctx.stroke() ctx.restore() }