Skip to content

Commit 40e3a89

Browse files
committed
Make sure list align up to 3 digits.
1 parent 0a76020 commit 40e3a89

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

Aztec/Classes/Constants/Metrics.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ public enum Metrics {
88

99
public static var defaultIndentation = CGFloat(12)
1010
public static var maxIndentation = CGFloat(200)
11-
public static var listTextIndentation = CGFloat(16)
11+
public static var listTextIndentation = CGFloat(12)
1212
public static var listTextCharIndentation = CGFloat(8)
1313
public static var tabStepInterval = 4
1414
public static var tabStepCount = 12

Aztec/Classes/TextKit/ParagraphStyle.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,8 @@ 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-
return Metrics.listTextIndentation + (markerSize * Metrics.listTextCharIndentation)
237+
let markerMinimum = max(3, markerSize)
238+
return Metrics.listTextIndentation + (markerMinimum * Metrics.listTextCharIndentation)
238239
}
239240
/// The amount of indent for the list of the paragraph if any.
240241
///

0 commit comments

Comments
 (0)