From 603b7e5cf342fe3d54ffe0dd5ca56cd465be6e8d Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Tue, 8 Nov 2022 13:30:24 +0200 Subject: [PATCH] Fixes vector-im/element-ios/issues/6441 - Incorrect timeline item text height calculation --- Riot/Modules/MatrixKit/Models/Room/MXKRoomBubbleCellData.m | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Riot/Modules/MatrixKit/Models/Room/MXKRoomBubbleCellData.m b/Riot/Modules/MatrixKit/Models/Room/MXKRoomBubbleCellData.m index 10233ea6df..53b084c3a5 100644 --- a/Riot/Modules/MatrixKit/Models/Room/MXKRoomBubbleCellData.m +++ b/Riot/Modules/MatrixKit/Models/Room/MXKRoomBubbleCellData.m @@ -538,6 +538,9 @@ - (CGSize)textContentSize:(NSAttributedString*)attributedText removeVerticalInse selectedTextView.frame = CGRectMake(0, 0, _maxTextViewWidth, 0); selectedTextView.attributedText = attributedText; + + // Force the layout manager to layout the text, fixes problems starting iOS 16 + [selectedTextView.layoutManager ensureLayoutForTextContainer:selectedTextView.textContainer]; CGSize size = [selectedTextView sizeThatFits:selectedTextView.frame.size];