From 2481547ef8e2fcbb11d2f0e1673fe57e037d2f87 Mon Sep 17 00:00:00 2001 From: Shahab HM <59169907+shahabhm@users.noreply.github.com> Date: Fri, 10 Feb 2023 16:27:24 +0330 Subject: [PATCH] fix RTL tooltip colorBox placement (#11061) * fix RTL tooltip colorBox placement #10771 * fix lint problem --- src/plugins/plugin.tooltip.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugins/plugin.tooltip.js b/src/plugins/plugin.tooltip.js index 6a13c8ff285..c11c11b54fb 100644 --- a/src/plugins/plugin.tooltip.js +++ b/src/plugins/plugin.tooltip.js @@ -782,7 +782,7 @@ export class Tooltip extends Element { _drawColorBox(ctx, pt, i, rtlHelper, options) { const labelColors = this.labelColors[i]; const labelPointStyle = this.labelPointStyles[i]; - const {boxHeight, boxWidth, boxPadding} = options; + const {boxHeight, boxWidth} = options; const bodyFont = toFont(options.bodyFont); const colorX = getAlignedX(this, 'left', options); const rtlColorX = rtlHelper.x(colorX); @@ -818,8 +818,8 @@ export class Tooltip extends Element { ctx.lineDashOffset = labelColors.borderDashOffset || 0; // Fill a white rect so that colours merge nicely if the opacity is < 1 - const outerX = rtlHelper.leftForLtr(rtlColorX, boxWidth - boxPadding); - const innerX = rtlHelper.leftForLtr(rtlHelper.xPlus(rtlColorX, 1), boxWidth - boxPadding - 2); + const outerX = rtlHelper.leftForLtr(rtlColorX, boxWidth); + const innerX = rtlHelper.leftForLtr(rtlHelper.xPlus(rtlColorX, 1), boxWidth - 2); const borderRadius = toTRBLCorners(labelColors.borderRadius); if (Object.values(borderRadius).some(v => v !== 0)) {