File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
packages/s2-core/src/facet Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -550,7 +550,17 @@ export abstract class BaseFacet {
550550 const textHeight = cell . getActualTextHeight ( ) ;
551551 const adaptiveHeight = textHeight + padding . top + padding . bottom ;
552552
553- const height = Math . max ( adaptiveHeight , defaultHeight ) ;
553+ // Check if text actually uses multiple lines
554+ const singleLineHeight = cell . getTextLineHeight ( ) ;
555+ const hasWrappedText = textHeight > singleLineHeight * 1.5 ;
556+
557+ // Use adaptive height when:
558+ // 1. Text actually wraps (uses multiple lines), OR
559+ // 2. Text height exceeds default height
560+ const needsAdaptiveHeight = hasWrappedText || textHeight >= defaultHeight ;
561+ const height = needsAdaptiveHeight
562+ ? Math . max ( adaptiveHeight , defaultHeight )
563+ : defaultHeight ;
554564
555565 this . textWrapNodeHeightCache . set ( cacheKey , height ) ;
556566
You can’t perform that action at this time.
0 commit comments