From 2002ca058bdc05cea8742ce109e6ebd8b3f97316 Mon Sep 17 00:00:00 2001 From: Pikamander2 Date: Thu, 1 Sep 2016 02:18:42 -0400 Subject: [PATCH 1/2] Fix zero border width not working (issue #3241) --- src/core/core.legend.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/core/core.legend.js b/src/core/core.legend.js index a13151bd3..8d1fb4b7e 100644 --- a/src/core/core.legend.js +++ b/src/core/core.legend.js @@ -324,6 +324,7 @@ module.exports = function(Chart) { ctx.lineJoin = itemOrDefault(legendItem.lineJoin, lineDefault.borderJoinStyle); ctx.lineWidth = itemOrDefault(legendItem.lineWidth, lineDefault.borderWidth); ctx.strokeStyle = itemOrDefault(legendItem.strokeStyle, globalDefault.defaultColor); + var isLineWidthZero = (itemOrDefault(legendItem.lineWidth, lineDefault.borderWidth) == 0); if (ctx.setLineDash) { // IE 9 and 10 do not support line dash @@ -343,7 +344,10 @@ module.exports = function(Chart) { } else { // Draw box as legend symbol - ctx.strokeRect(x, y, boxWidth, fontSize); + if (!isLineWidthZero) + { + ctx.strokeRect(x, y, boxWidth, fontSize); + } ctx.fillRect(x, y, boxWidth, fontSize); } From f3c51fc624b17284fbd5240bc71e165d0f99d6cb Mon Sep 17 00:00:00 2001 From: Pikamander2 Date: Thu, 1 Sep 2016 02:28:10 -0400 Subject: [PATCH 2/2] Fix zero border width not working (issue #3241) --- src/core/core.legend.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/core.legend.js b/src/core/core.legend.js index 8d1fb4b7e..ffe42c904 100644 --- a/src/core/core.legend.js +++ b/src/core/core.legend.js @@ -324,7 +324,7 @@ module.exports = function(Chart) { ctx.lineJoin = itemOrDefault(legendItem.lineJoin, lineDefault.borderJoinStyle); ctx.lineWidth = itemOrDefault(legendItem.lineWidth, lineDefault.borderWidth); ctx.strokeStyle = itemOrDefault(legendItem.strokeStyle, globalDefault.defaultColor); - var isLineWidthZero = (itemOrDefault(legendItem.lineWidth, lineDefault.borderWidth) == 0); + var isLineWidthZero = (itemOrDefault(legendItem.lineWidth, lineDefault.borderWidth) === 0); if (ctx.setLineDash) { // IE 9 and 10 do not support line dash