From 3379c61ad1a59e68b099ac6a88d48725e17389de Mon Sep 17 00:00:00 2001 From: Kurban Sagitov <58472509+krbns@users.noreply.github.com> Date: Fri, 24 Apr 2026 15:20:24 +0300 Subject: [PATCH] PR:Fix mention pill cut off (#6622) * Fix mention pill cut off * trigger CI after screenshots * trigger CI after screenshots --- .../android/libraries/textcomposer/mentions/MentionSpan.kt | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/libraries/textcomposer/impl/src/main/kotlin/io/element/android/libraries/textcomposer/mentions/MentionSpan.kt b/libraries/textcomposer/impl/src/main/kotlin/io/element/android/libraries/textcomposer/mentions/MentionSpan.kt index b0f973b6b9..e2ae08c421 100644 --- a/libraries/textcomposer/impl/src/main/kotlin/io/element/android/libraries/textcomposer/mentions/MentionSpan.kt +++ b/libraries/textcomposer/impl/src/main/kotlin/io/element/android/libraries/textcomposer/mentions/MentionSpan.kt @@ -105,15 +105,12 @@ class MentionSpan( bottom: Int, paint: Paint ) { - // Extra vertical space to add below the baseline (y). This helps us center the span vertically - val extraVerticalSpace = y + paint.ascent() + paint.descent() - top - val availableWidth = (canvas.width - x).coerceAtLeast(0f) val measuredWidth = measuredTextWidth + startPadding + endPadding val pillWidth = minOf(availableWidth, measuredWidth.toFloat()) backgroundPaint.color = backgroundColor - val rect = RectF(x, top.toFloat(), x + pillWidth, y.toFloat() + extraVerticalSpace) + val rect = RectF(x, top.toFloat(), x + pillWidth, bottom.toFloat()) val radius = rect.height() / 2 canvas.drawRoundRect(rect, radius, radius, backgroundPaint)