mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-20 16:42:44 +02:00
Merge commit '3d672a05b2a7117ade2e4e87bd2b5762063d7922' into feature/3977_merge_element_1_9_13
# Conflicts: # Config/AppVersion.xcconfig # Podfile.lock # Riot/Modules/Application/LegacyAppDelegate.m # Riot/Modules/Authentication/AuthenticationCoordinator.swift # Riot/Modules/Authentication/Legacy/LegacyAuthenticationCoordinator.swift # Riot/Modules/LaunchLoading/LaunchLoadingView.swift # Riot/Modules/LaunchLoading/LaunchLoadingView.xib # Riot/Modules/MatrixKit/Models/Account/MXKAccount.m # Riot/Modules/MatrixKit/Models/Room/MXKRoomBubbleCellData.m # Riot/Modules/Room/TimelineCells/Styles/Bubble/BubbleRoomTimelineCellProvider.m # Riot/Modules/Room/TimelineCells/Styles/Plain/PlainRoomTimelineCellProvider.m # Riot/Modules/TabBar/MasterTabBarController.m # fastlane/Fastfile
This commit is contained in:
@@ -518,7 +518,6 @@
|
||||
|
||||
- (CGSize)textContentSize:(NSAttributedString*)attributedText removeVerticalInset:(BOOL)removeVerticalInset
|
||||
{
|
||||
|
||||
static UITextView* measurementTextView = nil;
|
||||
static UITextView* measurementTextViewWithoutInset = nil;
|
||||
|
||||
@@ -527,24 +526,23 @@
|
||||
if (!measurementTextView)
|
||||
{
|
||||
measurementTextView = [[UITextView alloc] init];
|
||||
|
||||
measurementTextViewWithoutInset = [[UITextView alloc] init];
|
||||
// Remove the container inset: this operation impacts only the vertical margin.
|
||||
// Note: consider textContainer.lineFragmentPadding to remove horizontal margin
|
||||
measurementTextViewWithoutInset.textContainerInset = UIEdgeInsetsZero;
|
||||
}
|
||||
|
||||
|
||||
// Select the right text view for measurement
|
||||
UITextView *selectedTextView = (removeVerticalInset ? measurementTextViewWithoutInset : measurementTextView);
|
||||
|
||||
|
||||
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];
|
||||
|
||||
|
||||
// Manage the case where a string attribute has a single paragraph with a left indent
|
||||
// In this case, [UITextView sizeThatFits] ignores the indent and return the width
|
||||
// of the text only.
|
||||
@@ -557,8 +555,10 @@
|
||||
{
|
||||
size.width = size.width + paragraphStyle.headIndent;
|
||||
}
|
||||
|
||||
return size;
|
||||
}
|
||||
|
||||
return CGSizeZero;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user