From 9e3163784287168cf0f6a2f5547e47ae84fe4133 Mon Sep 17 00:00:00 2001 From: homekuanyi Date: Tue, 8 Aug 2023 13:56:36 +0800 Subject: [PATCH] Update Drawing.swift: fix lineIndex out of range --- Source/Classes/Drawing/Drawing.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Classes/Drawing/Drawing.swift b/Source/Classes/Drawing/Drawing.swift index cf224e0..136e53c 100644 --- a/Source/Classes/Drawing/Drawing.swift +++ b/Source/Classes/Drawing/Drawing.swift @@ -159,6 +159,7 @@ extension NantesLabel { let width = CGFloat(CTLineGetTypographicBounds(line, &ascent, &descent, &leading)) guard let glyphRuns = CTLineGetGlyphRuns(line) as [AnyObject] as? [CTRun] else { + lineIndex += 1 continue } @@ -174,7 +175,6 @@ extension NantesLabel { let lineWidth: CGFloat = attributes[.nantesLabelBackgroundLineWidth] as? CGFloat ?? 0.0 guard strokeColor != nil || fillColor != nil else { - lineIndex += 1 continue }