1
0
mirror of https://github.com/emilk/egui.git synced 2026-09-01 06:10:06 -04:00
This commit is contained in:
Emil Ernerfeldt
2025-03-28 16:09:40 +01:00
parent 2fb0764a24
commit 33ff4bd7da

View File

@@ -811,13 +811,12 @@ impl GalleyCache {
) -> Galley { ) -> Galley {
profiling::function_scope!(); profiling::function_scope!();
let mut current = 0; let mut start = 0;
let mut max_rows_remaining = job.wrap.max_rows; let mut max_rows_remaining = job.wrap.max_rows;
let mut galleys = Vec::new(); let mut galleys = Vec::new();
while current < job.text.len() { while start < job.text.len() {
let is_first_paragraph = current == 0; let is_first_paragraph = start == 0;
let start = current;
let end = job.text[start..] let end = job.text[start..]
.find('\n') .find('\n')
.map_or(job.text.len(), |i| start + i + 1); .map_or(job.text.len(), |i| start + i + 1);
@@ -887,7 +886,7 @@ impl GalleyCache {
break; break;
} }
current = end; start = end;
} }
Galley::concat(job, &galleys, fonts.pixels_per_point) Galley::concat(job, &galleys, fonts.pixels_per_point)