1
0
mirror of https://github.com/emilk/egui.git synced 2026-06-28 07:23:13 -04:00

Implement rotating text

Closes https://github.com/emilk/egui/issues/428
This commit is contained in:
Emil Ernerfeldt
2021-09-05 09:06:53 +02:00
parent 6902151a96
commit 14c989fdfa
12 changed files with 112 additions and 69 deletions

View File

@@ -24,17 +24,13 @@ pub fn adjust_colors(shape: &mut Shape, adjust_color: &impl Fn(&mut Color32)) {
adjust_color(fill);
adjust_color(&mut stroke.color);
}
Shape::Text {
galley,
override_text_color,
..
} => {
if let Some(override_text_color) = override_text_color {
Shape::Text(text_shape) => {
if let Some(override_text_color) = &mut text_shape.override_text_color {
adjust_color(override_text_color);
}
if !galley.is_empty() {
let galley = std::sync::Arc::make_mut(galley);
if !text_shape.galley.is_empty() {
let galley = std::sync::Arc::make_mut(&mut text_shape.galley);
for row in &mut galley.rows {
for vertex in &mut row.visuals.mesh.vertices {
adjust_color(&mut vertex.color);