From c6e8d0e08ad5306f265ba21b01597920d2274120 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20St=C3=B8vring?= Date: Sat, 16 Mar 2024 16:26:51 +0100 Subject: [PATCH 1/2] Removes lineHeightMultiplier from DefaultStringAttributes --- Sources/Runestone/Library/DefaultStringAttributes.swift | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Sources/Runestone/Library/DefaultStringAttributes.swift b/Sources/Runestone/Library/DefaultStringAttributes.swift index 630982e0..5840d17c 100644 --- a/Sources/Runestone/Library/DefaultStringAttributes.swift +++ b/Sources/Runestone/Library/DefaultStringAttributes.swift @@ -6,27 +6,23 @@ struct DefaultStringAttributes { private let font: UIFont private let kern: CGFloat private let tabWidth: CGFloat - private let lineHeightMultiplier: CGFloat init( textColor: UIColor, font: UIFont, kern: CGFloat, - tabWidth: CGFloat, - lineHeightMultiplier: CGFloat = 1 + tabWidth: CGFloat ) { self.textColor = textColor self.font = font self.kern = kern self.tabWidth = tabWidth - self.lineHeightMultiplier = lineHeightMultiplier } func apply(to attributedString: NSMutableAttributedString) { let paragraphStyle = NSMutableParagraphStyle() paragraphStyle.tabStops = [] paragraphStyle.defaultTabInterval = tabWidth - paragraphStyle.lineHeightMultiple = lineHeightMultiplier let range = NSRange(location: 0, length: attributedString.length) let attributes: [NSAttributedString.Key: Any] = [ .foregroundColor: textColor, From 6c4e13efca617adf625112240eccf48196b5a101 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20St=C3=B8vring?= Date: Sat, 16 Mar 2024 16:33:33 +0100 Subject: [PATCH 2/2] Removes initializer --- .../Library/DefaultStringAttributes.swift | 20 ++++--------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/Sources/Runestone/Library/DefaultStringAttributes.swift b/Sources/Runestone/Library/DefaultStringAttributes.swift index 5840d17c..8784b828 100644 --- a/Sources/Runestone/Library/DefaultStringAttributes.swift +++ b/Sources/Runestone/Library/DefaultStringAttributes.swift @@ -2,22 +2,10 @@ import Foundation import UIKit struct DefaultStringAttributes { - private let textColor: UIColor - private let font: UIFont - private let kern: CGFloat - private let tabWidth: CGFloat - - init( - textColor: UIColor, - font: UIFont, - kern: CGFloat, - tabWidth: CGFloat - ) { - self.textColor = textColor - self.font = font - self.kern = kern - self.tabWidth = tabWidth - } + let textColor: UIColor + let font: UIFont + let kern: CGFloat + let tabWidth: CGFloat func apply(to attributedString: NSMutableAttributedString) { let paragraphStyle = NSMutableParagraphStyle()