Skip to content

Commit e82eb48

Browse files
Abbondanzofacebook-github-bot
authored andcommitted
Set display density on prepared text layout paint (#59213)
Summary: When prepared text layout is enabled, PreparedLayoutTextView draws the cached Layout directly. That Layout is built with a fresh TextPaint that never received the display density, so custom decoration drawing that scales with paint.density rendered wrong: the DOUBLE underline/linethrough gap (thickness + 2dp) collapsed to zero and the two strokes merged into one solid band. Changelog: [Android][Fixed] - Fix double text decorations rendering as a solid band when prepared text layout is enabled Differential Revision: D126198343
1 parent f1f516e commit e82eb48

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

‎packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManager.kt‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1107,6 +1107,7 @@ internal object TextLayoutManager {
11071107
fontWeightAdjustment: Int,
11081108
): TextPaint {
11091109
val paint = TextPaint(TextPaint.ANTI_ALIAS_FLAG)
1110+
paint.density = DisplayMetricsHolder.getScreenDisplayMetrics().density
11101111
updateTextPaint(paint, baseTextAttributes, assets, fontWeightAdjustment)
11111112
return paint
11121113
}

0 commit comments

Comments
 (0)