From: Dominic Jean Date: Sat, 18 Jan 2020 13:32:09 +0000 (-0500) Subject: fix drawPoints parameter (#6975) X-Git-Tag: v3.0.0-alpha~116 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=95345d01dce5d1967defa2777c0a3d8864137088;p=thirdparty%2FChart.js.git fix drawPoints parameter (#6975) --- diff --git a/src/plugins/plugin.legend.js b/src/plugins/plugin.legend.js index 5fe836bc2..fd014e61c 100644 --- a/src/plugins/plugin.legend.js +++ b/src/plugins/plugin.legend.js @@ -389,12 +389,17 @@ class Legend extends Element { if (labelOpts && labelOpts.usePointStyle) { // Recalculate x and y for drawPoint() because its expecting // x and y to be center of figure (instead of top left) - var radius = boxWidth * Math.SQRT2 / 2; + const drawOptions = { + radius: boxWidth * Math.SQRT2 / 2, + pointStyle: legendItem.pointStyle, + rotation: legendItem.rotation, + borderWidth: lineWidth + }; var centerX = rtlHelper.xPlus(x, boxWidth / 2); var centerY = y + fontSize / 2; // Draw pointStyle as legend symbol - helpers.canvas.drawPoint(ctx, legendItem.pointStyle, radius, centerX, centerY, legendItem.rotation); + helpers.canvas.drawPoint(ctx, drawOptions, centerX, centerY); } else { // Draw box as legend symbol ctx.fillRect(rtlHelper.leftForLtr(x, boxWidth), y, boxWidth, fontSize);