@@ -484,8 +484,8 @@ class ZRText extends Displayable<TextProps> implements GroupLike {
484
484
const needDrawBg = needDrawBackground ( style ) ;
485
485
const bgColorDrawn = ! ! ( style . backgroundColor ) ;
486
486
487
- // outerWidth is the real text width containing padding.
488
487
const outerHeight = contentBlock . outerHeight ;
488
+ const outerWidth = contentBlock . outerWidth ;
489
489
const contentWidth = contentBlock . contentWidth ;
490
490
491
491
const textLines = contentBlock . lines ;
@@ -503,10 +503,9 @@ class ZRText extends Displayable<TextProps> implements GroupLike {
503
503
504
504
if ( needDrawBg || textPadding ) {
505
505
// Consider performance, do not call getTextWidth util necessary.
506
- const boxX = adjustTextX ( baseX , contentWidth , textAlign ) ;
506
+ const boxX = adjustTextX ( baseX , outerWidth , textAlign ) ;
507
507
const boxY = adjustTextY ( baseY , outerHeight , verticalAlign ) ;
508
-
509
- needDrawBg && this . _renderBackground ( style , style , boxX , boxY , contentWidth , outerHeight ) ;
508
+ needDrawBg && this . _renderBackground ( style , style , boxX , boxY , outerWidth , outerHeight ) ;
510
509
}
511
510
512
511
// `textBaseline` is set as 'middle'.
@@ -605,7 +604,7 @@ class ZRText extends Displayable<TextProps> implements GroupLike {
605
604
* Otherwise, there will be extra space in the
606
605
* bounding rect calculated.
607
606
*/
608
- innerWidth ,
607
+ contentWidth ,
609
608
calculatedLineHeight
610
609
) ) ;
611
610
}
0 commit comments