Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/component/tooltip/TooltipHTMLContent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

import { isString, indexOf, each, bind, isFunction, isArray, isDom } from 'zrender/src/core/util';
import { isString, indexOf, each, bind, isFunction, isArray, isDom, retrieve2 } from 'zrender/src/core/util';
import { normalizeEvent } from 'zrender/src/core/event';
import { transformLocalCoord } from 'zrender/src/core/dom';
import env from 'zrender/src/core/env';
Expand Down Expand Up @@ -152,7 +152,7 @@ function assembleFont(textStyleModel: Model<TooltipOption['textStyle']>): string
cssText.push('font:' + textStyleModel.getFont());

// @ts-ignore, leave it to the tooltip refactor.
const lineHeight = textStyleModel.get('lineHeight') ?? Math.round(fontSize * 3 / 2);
const lineHeight = retrieve2(textStyleModel.get('lineHeight'), Math.round(fontSize * 3 / 2));

fontSize
&& cssText.push('line-height:' + lineHeight + 'px');
Expand Down
2 changes: 1 addition & 1 deletion src/component/tooltip/tooltipMarkup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function getTooltipLineHeight(
textStyle: TooltipOption['textStyle']
) {
const lineHeight = textStyle.lineHeight;
if (lineHeight === undefined) {
if (lineHeight === undefined || lineHeight === null) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use lineHeight == null should be enough.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, that's work well

return TOOLTIP_LINE_HEIGHT_CSS;
}
else {
Expand Down