Skip to content

Commit 0132095

Browse files
committed
Replace magic number by proper constant.
1 parent 40e3a89 commit 0132095

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

Aztec/Classes/Constants/Metrics.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ public enum Metrics {
1010
public static var maxIndentation = CGFloat(200)
1111
public static var listTextIndentation = CGFloat(12)
1212
public static var listTextCharIndentation = CGFloat(8)
13+
public static var listMinimumIndentChars = 3
1314
public static var tabStepInterval = 4
1415
public static var tabStepCount = 12
1516
public static var paragraphSpacing = CGFloat(6)

Aztec/Classes/TextKit/ParagraphStyle.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ open class ParagraphStyle: NSMutableParagraphStyle, CustomReflectable {
234234

235235
private func indent(for list: TextList) -> CGFloat {
236236
let markerSize = CGFloat(list.style.markerText(forItemNumber: list.start ?? 1).count)
237-
let markerMinimum = max(3, markerSize)
237+
let markerMinimum = max(CGFloat(Metrics.listMinimumIndentChars), markerSize)
238238
return Metrics.listTextIndentation + (markerMinimum * Metrics.listTextCharIndentation)
239239
}
240240
/// The amount of indent for the list of the paragraph if any.

0 commit comments

Comments
 (0)