LibGUI: Use a while loop for iterating text spans
This commit is contained in:
parent
04deb81f71
commit
efd56cda6a
Notes:
sideshowbarker
2024-07-17 01:23:08 +09:00
Author: https://github.com/AtkinsSJ Commit: https://github.com/SerenityOS/serenity/commit/efd56cda6a Pull-request: https://github.com/SerenityOS/serenity/pull/17556 Reviewed-by: https://github.com/awesomekling ✅
1 changed files with 1 additions and 4 deletions
|
@ -579,10 +579,7 @@ void TextEditor::paint_event(PaintEvent& event)
|
|||
draw_text(span_rect, text, *font, m_text_alignment, text_attributes);
|
||||
span_rect.translate_by(span_rect.width(), 0);
|
||||
};
|
||||
for (;;) {
|
||||
if (span_index >= document().spans().size()) {
|
||||
break;
|
||||
}
|
||||
while (span_index < document().spans().size()) {
|
||||
auto& span = document().spans()[span_index];
|
||||
if (span.range.start().line() > line_index
|
||||
|| (span.range.start().line() == line_index && span.range.start().column() >= start_of_visual_line + visual_line_text.length())) {
|
||||
|
|
Loading…
Add table
Reference in a new issue