@@ -780,7 +780,7 @@ export class Tooltip extends Element {
780
780
* @private
781
781
*/
782
782
_drawColorBox ( ctx , pt , i , rtlHelper , options ) {
783
- const labelColors = this . labelColors [ i ] ;
783
+ const labelColor = this . labelColors [ i ] ;
784
784
const labelPointStyle = this . labelPointStyles [ i ] ;
785
785
const { boxHeight, boxWidth} = options ;
786
786
const bodyFont = toFont ( options . bodyFont ) ;
@@ -807,20 +807,20 @@ export class Tooltip extends Element {
807
807
drawPoint ( ctx , drawOptions , centerX , centerY ) ;
808
808
809
809
// Draw the point
810
- ctx . strokeStyle = labelColors . borderColor ;
811
- ctx . fillStyle = labelColors . backgroundColor ;
810
+ ctx . strokeStyle = labelColor . borderColor ;
811
+ ctx . fillStyle = labelColor . backgroundColor ;
812
812
drawPoint ( ctx , drawOptions , centerX , centerY ) ;
813
813
} else {
814
814
// Border
815
- ctx . lineWidth = isObject ( labelColors . borderWidth ) ? Math . max ( ...Object . values ( labelColors . borderWidth ) ) : ( labelColors . borderWidth || 1 ) ; // TODO, v4 remove fallback
816
- ctx . strokeStyle = labelColors . borderColor ;
817
- ctx . setLineDash ( labelColors . borderDash || [ ] ) ;
818
- ctx . lineDashOffset = labelColors . borderDashOffset || 0 ;
815
+ ctx . lineWidth = isObject ( labelColor . borderWidth ) ? Math . max ( ...Object . values ( labelColor . borderWidth ) ) : ( labelColor . borderWidth || 1 ) ; // TODO, v4 remove fallback
816
+ ctx . strokeStyle = labelColor . borderColor ;
817
+ ctx . setLineDash ( labelColor . borderDash || [ ] ) ;
818
+ ctx . lineDashOffset = labelColor . borderDashOffset || 0 ;
819
819
820
820
// Fill a white rect so that colours merge nicely if the opacity is < 1
821
821
const outerX = rtlHelper . leftForLtr ( rtlColorX , boxWidth ) ;
822
822
const innerX = rtlHelper . leftForLtr ( rtlHelper . xPlus ( rtlColorX , 1 ) , boxWidth - 2 ) ;
823
- const borderRadius = toTRBLCorners ( labelColors . borderRadius ) ;
823
+ const borderRadius = toTRBLCorners ( labelColor . borderRadius ) ;
824
824
825
825
if ( Object . values ( borderRadius ) . some ( v => v !== 0 ) ) {
826
826
ctx . beginPath ( ) ;
@@ -836,7 +836,7 @@ export class Tooltip extends Element {
836
836
ctx . stroke ( ) ;
837
837
838
838
// Inner square
839
- ctx . fillStyle = labelColors . backgroundColor ;
839
+ ctx . fillStyle = labelColor . backgroundColor ;
840
840
ctx . beginPath ( ) ;
841
841
addRoundedRectPath ( ctx , {
842
842
x : innerX ,
@@ -852,7 +852,7 @@ export class Tooltip extends Element {
852
852
ctx . fillRect ( outerX , colorY , boxWidth , boxHeight ) ;
853
853
ctx . strokeRect ( outerX , colorY , boxWidth , boxHeight ) ;
854
854
// Inner square
855
- ctx . fillStyle = labelColors . backgroundColor ;
855
+ ctx . fillStyle = labelColor . backgroundColor ;
856
856
ctx . fillRect ( innerX , colorY + 1 , boxWidth - 2 , boxHeight - 2 ) ;
857
857
}
858
858
}
0 commit comments