From 97fec7ab12e8c971f294d8bf0fdd95978b8f435a Mon Sep 17 00:00:00 2001 From: Faraz Khonsari Date: Sat, 24 Oct 2020 18:29:47 +0330 Subject: [PATCH] Update MessageObject.java sometimes when we have a lot of space and also mix of RTL and LTR characters background width will be more than display width. --- .../src/main/java/org/telegram/messenger/MessageObject.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/TMessagesProj/src/main/java/org/telegram/messenger/MessageObject.java b/TMessagesProj/src/main/java/org/telegram/messenger/MessageObject.java index bed245799..2798976c3 100644 --- a/TMessagesProj/src/main/java/org/telegram/messenger/MessageObject.java +++ b/TMessagesProj/src/main/java/org/telegram/messenger/MessageObject.java @@ -4055,6 +4055,8 @@ public class MessageObject { linesMaxWidth = Math.max(linesMaxWidth, (int) Math.ceil(lineWidth)); linesMaxWidthWithLeft = Math.max(linesMaxWidthWithLeft, (int) Math.ceil(lineWidth + lineLeft)); } + lastLineWidthWithLeft = Math.min(lastLineWidthWithLeft, maxWidth); + textRealMaxWidthWithLeft = Math.min(textRealMaxWidthWithLeft, maxWidth); if (hasNonRTL) { textRealMaxWidth = textRealMaxWidthWithLeft; if (a == blocksCount - 1) {