]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
pass boxWidth only if pointStyleWidth presents (#10524)
authorDominic Jean <touletan@hotmail.com>
Fri, 29 Jul 2022 13:40:28 +0000 (09:40 -0400)
committerGitHub <noreply@github.com>
Fri, 29 Jul 2022 13:40:28 +0000 (16:40 +0300)
src/plugins/plugin.legend.js

index 7c67cb52def7b895b9a5ac3fa6b4ee8692faf91e..936111d848f83c1a476f8bad8cc51c074bd47a79 100644 (file)
@@ -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)