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

Add Shape::galley_with_color (#1461)

This commit is contained in:
Zachary Kohnen
2022-04-06 18:47:46 +02:00
committed by GitHub
parent 68d5806b41
commit dffab1c737
3 changed files with 17 additions and 5 deletions

View File

@@ -179,6 +179,20 @@ impl Shape {
TextShape::new(pos, galley).into()
}
#[inline]
/// The text color in the [`Galley`] will be replaced with the given color.
pub fn galley_with_color(
pos: Pos2,
galley: crate::mutex::Arc<Galley>,
text_color: Color32,
) -> Self {
TextShape {
override_text_color: Some(text_color),
..TextShape::new(pos, galley)
}
.into()
}
pub fn mesh(mesh: Mesh) -> Self {
crate::epaint_assert!(mesh.is_valid());
Self::Mesh(mesh)