diff --git a/MVMCoreUI/Atoms/Views/Label.swift b/MVMCoreUI/Atoms/Views/Label.swift index a524dbac..858e87d6 100644 --- a/MVMCoreUI/Atoms/Views/Label.swift +++ b/MVMCoreUI/Atoms/Views/Label.swift @@ -342,14 +342,11 @@ public typealias ActionBlock = () -> Void } } - /** - Appends an external link imcage to the end of the attributed string. - - - Attention: This method expects text to be set first. Otherwise, it will do nothing. - - Parameters: - - magnitude: Applied to Width and Height of image for congruency. - */ - public func addExternalLinkIcon(magnitude: Int = 12) { + + ///Appends an external link image to the end of the attributed string. + public func addExternalLinkIcon() { + + let size = round(font.pointSize * 0.8) guard let attributedText = self.attributedText else { return } @@ -357,7 +354,7 @@ public typealias ActionBlock = () -> Void let imageAttachment = NSTextAttachment() imageAttachment.image = MVMCoreUIUtility.imageNamed("externalLink") - imageAttachment.bounds = CGRect(x: 0, y: 0, width: magnitude, height: magnitude) + imageAttachment.bounds = CGRect(x: 0, y: 0, width: size, height: size) fullString.append(NSAttributedString(string: " ")) fullString.append(NSAttributedString(attachment: imageAttachment))