Skip to content

Commit 8ccff8c

Browse files
authored
draw tooltip with object borderwidth (#10489)
1 parent 341f903 commit 8ccff8c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/plugins/plugin.tooltip.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import Animations from '../core/core.animations';
22
import Element from '../core/core.element';
33
import {addRoundedRectPath} from '../helpers/helpers.canvas';
4-
import {each, noop, isNullOrUndef, isArray, _elementsEqual} from '../helpers/helpers.core';
4+
import {each, noop, isNullOrUndef, isArray, _elementsEqual, isObject} from '../helpers/helpers.core';
55
import {toFont, toPadding, toTRBLCorners} from '../helpers/helpers.options';
66
import {getRtlAdapter, overrideTextDirection, restoreTextDirection} from '../helpers/helpers.rtl';
77
import {distanceBetweenPoints, _limitValue} from '../helpers/helpers.math';
@@ -707,7 +707,7 @@ export class Tooltip extends Element {
707707
drawPoint(ctx, drawOptions, centerX, centerY);
708708
} else {
709709
// Border
710-
ctx.lineWidth = labelColors.borderWidth || 1; // TODO, v4 remove fallback
710+
ctx.lineWidth = isObject(labelColors.borderWidth) ? Math.max(...Object.values(labelColors.borderWidth)) : (labelColors.borderWidth || 1); // TODO, v4 remove fallback
711711
ctx.strokeStyle = labelColors.borderColor;
712712
ctx.setLineDash(labelColors.borderDash || []);
713713
ctx.lineDashOffset = labelColors.borderDashOffset || 0;

0 commit comments

Comments
 (0)