mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 15:27:35 +00:00
LibGUI: Use a while loop for iterating text spans
This commit is contained in:
parent
04deb81f71
commit
efd56cda6a
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);
|
draw_text(span_rect, text, *font, m_text_alignment, text_attributes);
|
||||||
span_rect.translate_by(span_rect.width(), 0);
|
span_rect.translate_by(span_rect.width(), 0);
|
||||||
};
|
};
|
||||||
for (;;) {
|
while (span_index < document().spans().size()) {
|
||||||
if (span_index >= document().spans().size()) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
auto& span = document().spans()[span_index];
|
auto& span = document().spans()[span_index];
|
||||||
if (span.range.start().line() > line_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())) {
|
|| (span.range.start().line() == line_index && span.range.start().column() >= start_of_visual_line + visual_line_text.length())) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue