From 55217c21c3e29321f91982ccdfeed3ea0c3ee072 Mon Sep 17 00:00:00 2001 From: Kevin G Christiano Date: Wed, 24 Feb 2021 10:14:05 -0500 Subject: [PATCH] undo --- MVMCoreUI/Atomic/Atoms/Views/Label/Label.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/MVMCoreUI/Atomic/Atoms/Views/Label/Label.swift b/MVMCoreUI/Atomic/Atoms/Views/Label/Label.swift index 91521b9b..511fb4dc 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/Label/Label.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/Label/Label.swift @@ -624,6 +624,9 @@ public typealias ActionBlock = () -> () } else if !MVMCoreGetterUtility.fequal(a: Float(standardFontSize), b: 0.0), let sizeObject = sizeObject ?? MFStyler.sizeObjectGeneric(forCurrentDevice: standardFontSize) { font = font.updateSize(sizeObject.getValueBased(onSize: size)) } + + // Provide the label additional size information to help calculate its intrinsic content. + preferredMaxLayoutWidth = Styler.maxAvailableLayoutWidth(size: size) } @objc public func setFont(_ font: UIFont, scale: Bool) { @@ -834,10 +837,7 @@ extension Label { fileprivate func setActionAttributes(range: NSRange) { - guard let attributedText = attributedText, - range.length > 0, - range.length <= attributedText.length - else { return } + guard let attributedText = attributedText else { return } let mutableAttributedString = NSMutableAttributedString(attributedString: attributedText) addActionAttributes(range: range, string: mutableAttributedString)