From 031a1d7325a6f1edc657e1f5e8cd78deafb59d54 Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Wed, 11 Apr 2018 11:18:08 -0400 Subject: [PATCH] Fix quoted message overflow. --- .../ConversationView/Cells/OWSQuotedMessageView.m | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Signal/src/ViewControllers/ConversationView/Cells/OWSQuotedMessageView.m b/Signal/src/ViewControllers/ConversationView/Cells/OWSQuotedMessageView.m index be41b18b8..f1bf3cbe5 100644 --- a/Signal/src/ViewControllers/ConversationView/Cells/OWSQuotedMessageView.m +++ b/Signal/src/ViewControllers/ConversationView/Cells/OWSQuotedMessageView.m @@ -347,6 +347,7 @@ NS_ASSUME_NONNULL_BEGIN CGSize quotedAuthorSize = CGSizeCeil([quotedAuthorLabel sizeThatFits:CGSizeMake(maxQuotedAuthorWidth, CGFLOAT_MAX)]); + quotedAuthorSize.width = MIN(quotedAuthorSize.width, maxQuotedAuthorWidth); quotedAuthorWidth = quotedAuthorSize.width; @@ -363,6 +364,7 @@ NS_ASSUME_NONNULL_BEGIN UILabel *quotedTextLabel = [self createQuotedTextLabel]; CGSize textSize = CGSizeCeil([quotedTextLabel sizeThatFits:CGSizeMake(maxQuotedTextWidth, CGFLOAT_MAX)]); + textSize.width = MIN(textSize.width, maxQuotedTextWidth); quotedTextWidth = textSize.width + self.quotedReplyStripeThickness + self.quotedReplyStripeHSpacing; result.height += textSize.height + self.quotedReplyStripeVExtension * 2;