From dffd1beac4f5fa588efd324924c9e55a22e7d57d Mon Sep 17 00:00:00 2001 From: Zach DeCook Date: Sun, 30 Apr 2017 19:38:42 -0400 Subject: - Fix empty bubble being drawn on cleared canvas. ChordCharter.drawChord("chordy", 30, 25, "", "111111"); context.clearRect(0, 0, canvas.width, canvas.height); ChordCharter.drawChord("chordy", 30, 25, "", "222222"); now no longer leaves weird empty bubble behind. --- scripts/ccharter.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/ccharter.js b/scripts/ccharter.js index 81c2dd4..353c081 100644 --- a/scripts/ccharter.js +++ b/scripts/ccharter.js @@ -13,7 +13,10 @@ var ChordCharter = { var origin = { x: originX, y: originY }; var props = { width: 50, height: 60 }; - + + // Reset previous path that may have been created. + ctx.beginPath(); + // horizontals for (counter in new Array(0, 1, 2, 3, 4)) { @@ -96,4 +99,4 @@ var ChordCharter = { ctx.fillText("3", origin.x - 10, origin.y + 41); } } -}; \ No newline at end of file +}; -- cgit 1.4.1