Open Airwen opened 2 months ago
-[YYTextLayout firstRectForRange:(YYTextRange *)]
NSUInteger startLineIndex = [self lineIndexForPosition:range.start]; NSUInteger endLineIndex = [self lineIndexForPosition:range.end]; /* ... 此处省略若干行代码 ... */ NSMutableArray *lines = [NSMutableArray new]; // 这里的 `for` 循环, `i <= startLineIndex` 是不是应该 `i <= endLineIndex` // 用来获取 range 范围内的相关 “line” for (NSUInteger i = startLineIndex; i <= startLineIndex; i++) { YYTextLine *line = _lines[i]; if (line.row != startLine.row) break; [lines addObject:line]; }
如果我解读有误,请指正~
-[YYTextLayout firstRectForRange:(YYTextRange *)]
如果我解读有误,请指正~