diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/TextAttributeProps.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/TextAttributeProps.kt index 4d6e8665be1..73d150d071c 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/TextAttributeProps.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/TextAttributeProps.kt @@ -134,17 +134,9 @@ public class TextAttributeProps private constructor() { public var fontFeatureSettings: String? = null private set - private var heightOfTallestInlineImage: Float = Float.NaN - + @Deprecated("Use lineHeight instead", ReplaceWith("lineHeight")) public val effectiveLineHeight: Float - // Returns a line height which takes into account the requested line height - get() { - val useInlineViewHeight = - !lineHeight.isNaN() && - !heightOfTallestInlineImage.isNaN() && - heightOfTallestInlineImage > lineHeight - return if (useInlineViewHeight) heightOfTallestInlineImage else lineHeight - } + get() = lineHeight private fun setNumberOfLines(numberOfLines: Int) { this.numberOfLines = if (numberOfLines == 0) ReactConstants.UNSET else numberOfLines diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManager.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManager.kt index 2a9ec5cb045..49fec8ee3a2 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManager.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManager.kt @@ -312,10 +312,8 @@ internal object TextLayoutManager { textAttributes.textShadowRadius, textAttributes.textShadowColor))) } - if (!textAttributes.effectiveLineHeight.isNaN()) { - ops.add( - SetSpanOperation( - start, end, CustomLineHeightSpan(textAttributes.effectiveLineHeight))) + if (!textAttributes.lineHeight.isNaN()) { + ops.add(SetSpanOperation(start, end, CustomLineHeightSpan(textAttributes.lineHeight))) } if (ReactNativeFeatureFlags.enablePreparedTextLayout()) { @@ -474,9 +472,8 @@ internal object TextLayoutManager { spanFlags) } - if (!fragment.props.effectiveLineHeight.isNaN()) { - spannable.setSpan( - CustomLineHeightSpan(fragment.props.effectiveLineHeight), start, end, spanFlags) + if (!fragment.props.lineHeight.isNaN()) { + spannable.setSpan(CustomLineHeightSpan(fragment.props.lineHeight), start, end, spanFlags) } if (ReactNativeFeatureFlags.enablePreparedTextLayout()) {