From: Dominic Jean Date: Fri, 29 Jul 2022 13:40:28 +0000 (-0400) Subject: pass boxWidth only if pointStyleWidth presents (#10524) X-Git-Tag: v3.9.0~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a31e1e59d6c33883b2932b422abaabf3a2340074;p=thirdparty%2FChart.js.git pass boxWidth only if pointStyleWidth presents (#10524) --- diff --git a/src/plugins/plugin.legend.js b/src/plugins/plugin.legend.js index 7c67cb52d..936111d84 100644 --- a/src/plugins/plugin.legend.js +++ b/src/plugins/plugin.legend.js @@ -325,7 +325,7 @@ export class Legend extends Element { const centerY = y + halfFontSize; // Draw pointStyle as legend symbol - drawPointLegend(ctx, drawOptions, centerX, centerY, boxWidth); + drawPointLegend(ctx, drawOptions, centerX, centerY, labelOpts.pointStyleWidth && boxWidth); } else { // Draw box as legend symbol // Adjust position when boxHeight < fontSize (want it centered)