mirror of
https://github.com/emilk/egui.git
synced 2026-08-29 04:40:03 -04:00
Implement BitOr and BitOrAssign for Rect (#7319)
This commit is contained in:
@@ -691,13 +691,12 @@ fn galley_from_rows(
|
||||
let mut num_indices = 0;
|
||||
|
||||
for placed_row in &mut rows {
|
||||
rect = rect.union(placed_row.rect());
|
||||
rect |= placed_row.rect();
|
||||
|
||||
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();
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user