Update
This commit is contained in:
parent
0115197751
commit
487b7bbe3c
2 changed files with 8 additions and 0 deletions
|
@ -119,6 +119,8 @@ pub struct TextArea<'a> {
|
|||
pub bounds: TextBounds,
|
||||
/// The default color of the text area.
|
||||
pub default_color: Color,
|
||||
/// The opacity of the text
|
||||
pub opacity: f32,
|
||||
/// Additional custom glyphs to render.
|
||||
pub custom_glyphs: &'a [CustomGlyph],
|
||||
}
|
||||
|
|
|
@ -246,6 +246,12 @@ impl TextRenderer {
|
|||
Some(some) => some,
|
||||
None => text_area.default_color,
|
||||
};
|
||||
let color = Color::rgba(
|
||||
(color.r() as f32 * text_area.opacity + 0.5) as u8,
|
||||
(color.g() as f32 * text_area.opacity + 0.5) as u8,
|
||||
(color.b() as f32 * text_area.opacity + 0.5) as u8,
|
||||
(color.a() as f32 * text_area.opacity + 0.5) as u8,
|
||||
);
|
||||
|
||||
if let Some(glyph_to_render) = prepare_glyph(
|
||||
physical_glyph.x,
|
||||
|
|
Loading…
Reference in a new issue