From cfad032f2906f0adec863c47f4e41a339ce02658 Mon Sep 17 00:00:00 2001 From: timshen Date: Wed, 16 Jun 2021 22:29:29 +0800 Subject: [PATCH] fix: legend text.lineHeight option not work --- src/graphic/Text.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/graphic/Text.ts b/src/graphic/Text.ts index 93ba480a6..53345ca4c 100644 --- a/src/graphic/Text.ts +++ b/src/graphic/Text.ts @@ -810,7 +810,7 @@ class ZRText extends Displayable { let rectEl: Rect; let imgEl: ZRImage; - if (isPlainOrGradientBg || (textBorderWidth && textBorderColor)) { + if (isPlainOrGradientBg || style.lineHeight || (textBorderWidth && textBorderColor)) { // Background is color rectEl = this._getOrCreateChild(Rect); rectEl.useStyle(rectEl.createStyle()); // Create an empty style. @@ -985,6 +985,7 @@ function getStyleText(style: TextStylePropsPart): string { function needDrawBackground(style: TextStylePropsPart): boolean { return !!( style.backgroundColor + || style.lineHeight || (style.borderWidth && style.borderColor) ); }