From 710ea88986d91173b37d72486f947ca5ffd0cfb4 Mon Sep 17 00:00:00 2001 From: Jacco van den Berg Date: Tue, 19 Jul 2022 16:25:05 +0200 Subject: [PATCH] draw tooltip with object borderwidth --- src/plugins/plugin.tooltip.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/plugin.tooltip.js b/src/plugins/plugin.tooltip.js index 965a7e82399..b21341c2817 100644 --- a/src/plugins/plugin.tooltip.js +++ b/src/plugins/plugin.tooltip.js @@ -1,7 +1,7 @@ import Animations from '../core/core.animations'; import Element from '../core/core.element'; import {addRoundedRectPath} from '../helpers/helpers.canvas'; -import {each, noop, isNullOrUndef, isArray, _elementsEqual} from '../helpers/helpers.core'; +import {each, noop, isNullOrUndef, isArray, _elementsEqual, isObject} from '../helpers/helpers.core'; import {toFont, toPadding, toTRBLCorners} from '../helpers/helpers.options'; import {getRtlAdapter, overrideTextDirection, restoreTextDirection} from '../helpers/helpers.rtl'; import {distanceBetweenPoints, _limitValue} from '../helpers/helpers.math'; @@ -707,7 +707,7 @@ export class Tooltip extends Element { drawPoint(ctx, drawOptions, centerX, centerY); } else { // Border - ctx.lineWidth = labelColors.borderWidth || 1; // TODO, v4 remove fallback + ctx.lineWidth = isObject(labelColors.borderWidth) ? Math.max(...Object.values(labelColors.borderWidth)) : (labelColors.borderWidth || 1); // TODO, v4 remove fallback ctx.strokeStyle = labelColors.borderColor; ctx.setLineDash(labelColors.borderDash || []); ctx.lineDashOffset = labelColors.borderDashOffset || 0;