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

Add epaint::Brush for controlling RectShape texturing (#5565)

Also wraps `Shape::Mesh` in an `Arc`.

No new features, but decreases size of `Shape` from 72 bytes to 64.
This commit is contained in:
Emil Ernerfeldt
2025-01-02 15:34:28 +01:00
committed by GitHub
parent 72ac2113dd
commit aeea70d9e7
7 changed files with 111 additions and 58 deletions

View File

@@ -64,8 +64,7 @@ pub fn adjust_colors(
fill,
stroke,
blur_width: _,
fill_texture_id: _,
uv: _,
brush: _,
}) => {
adjust_color(fill);
adjust_color(&mut stroke.color);
@@ -87,7 +86,7 @@ pub fn adjust_colors(
}
if !galley.is_empty() {
let galley = std::sync::Arc::make_mut(galley);
let galley = Arc::make_mut(galley);
for row in &mut galley.rows {
for vertex in &mut row.visuals.mesh.vertices {
adjust_color(&mut vertex.color);
@@ -96,11 +95,13 @@ pub fn adjust_colors(
}
}
Shape::Mesh(Mesh {
indices: _,
vertices,
texture_id: _,
}) => {
Shape::Mesh(mesh) => {
let Mesh {
indices: _,
vertices,
texture_id: _,
} = Arc::make_mut(mesh);
for v in vertices {
adjust_color(&mut v.color);
}