mirror of
https://github.com/emilk/egui.git
synced 2026-09-02 14:50:03 -04:00
Simplify layout_multiline loop loop into a while loop
This commit is contained in:
@@ -736,10 +736,9 @@ impl GalleyCache {
|
|||||||
let mut current = 0;
|
let mut current = 0;
|
||||||
let mut left_max_rows = job.wrap.max_rows;
|
let mut left_max_rows = job.wrap.max_rows;
|
||||||
let mut galleys = Vec::new();
|
let mut galleys = Vec::new();
|
||||||
let mut text_left = job.text.as_str();
|
|
||||||
let mut first_row_min_height = job.first_row_min_height;
|
let mut first_row_min_height = job.first_row_min_height;
|
||||||
loop {
|
while current != job.text.len() {
|
||||||
let end = text_left
|
let end = job.text[current..]
|
||||||
.find('\n')
|
.find('\n')
|
||||||
.map_or(job.text.len(), |i| i + current + 1);
|
.map_or(job.text.len(), |i| i + current + 1);
|
||||||
let start = current;
|
let start = current;
|
||||||
@@ -791,11 +790,6 @@ impl GalleyCache {
|
|||||||
galleys.push(galley);
|
galleys.push(galley);
|
||||||
|
|
||||||
current = end;
|
current = end;
|
||||||
if current >= job.text.len() {
|
|
||||||
break;
|
|
||||||
} else {
|
|
||||||
text_left = &job.text[current..];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut merged_galley = Galley {
|
let mut merged_galley = Galley {
|
||||||
|
|||||||
Reference in New Issue
Block a user