Skip to content

Commit 2481547

Browse files
authored
fix RTL tooltip colorBox placement (#11061)
* fix RTL tooltip colorBox placement #10771 * fix lint problem
1 parent cfefb3d commit 2481547

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/plugins/plugin.tooltip.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -782,7 +782,7 @@ export class Tooltip extends Element {
782782
_drawColorBox(ctx, pt, i, rtlHelper, options) {
783783
const labelColors = this.labelColors[i];
784784
const labelPointStyle = this.labelPointStyles[i];
785-
const {boxHeight, boxWidth, boxPadding} = options;
785+
const {boxHeight, boxWidth} = options;
786786
const bodyFont = toFont(options.bodyFont);
787787
const colorX = getAlignedX(this, 'left', options);
788788
const rtlColorX = rtlHelper.x(colorX);
@@ -818,8 +818,8 @@ export class Tooltip extends Element {
818818
ctx.lineDashOffset = labelColors.borderDashOffset || 0;
819819

820820
// Fill a white rect so that colours merge nicely if the opacity is < 1
821-
const outerX = rtlHelper.leftForLtr(rtlColorX, boxWidth - boxPadding);
822-
const innerX = rtlHelper.leftForLtr(rtlHelper.xPlus(rtlColorX, 1), boxWidth - boxPadding - 2);
821+
const outerX = rtlHelper.leftForLtr(rtlColorX, boxWidth);
822+
const innerX = rtlHelper.leftForLtr(rtlHelper.xPlus(rtlColorX, 1), boxWidth - 2);
823823
const borderRadius = toTRBLCorners(labelColors.borderRadius);
824824

825825
if (Object.values(borderRadius).some(v => v !== 0)) {

0 commit comments

Comments
 (0)