1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-31 22:00:03 -04:00

Replace some more union usages

This commit is contained in:
lucasmerlin
2025-07-09 14:59:51 +02:00
parent 86d1c0e40a
commit 57accb6e1d
8 changed files with 13 additions and 17 deletions

View File

@@ -696,8 +696,7 @@ fn galley_from_rows(
let row = Arc::make_mut(&mut placed_row.row);
row.visuals = tessellate_row(point_scale, &job, &format_summary, row);
mesh_bounds =
mesh_bounds.union(row.visuals.mesh_bounds.translate(placed_row.pos.to_vec2()));
mesh_bounds |= row.visuals.mesh_bounds.translate(placed_row.pos.to_vec2());
num_vertices += row.visuals.mesh.vertices.len();
num_indices += row.visuals.mesh.indices.len();

View File

@@ -865,12 +865,9 @@ impl Galley {
.extend(galley.rows.iter().enumerate().map(|(row_idx, placed_row)| {
let new_pos = placed_row.pos + current_y_offset * Vec2::Y;
let new_pos = new_pos.round_to_pixels(pixels_per_point);
merged_galley.mesh_bounds = merged_galley
.mesh_bounds
.union(placed_row.visuals.mesh_bounds.translate(new_pos.to_vec2()));
merged_galley.rect = merged_galley
.rect
.union(Rect::from_min_size(new_pos, placed_row.size));
merged_galley.mesh_bounds |=
placed_row.visuals.mesh_bounds.translate(new_pos.to_vec2());
merged_galley.rect |= Rect::from_min_size(new_pos, placed_row.size);
let mut row = placed_row.row.clone();
let is_last_row_in_galley = row_idx + 1 == galley.rows.len();