implement text support in canvas widget
This commit is contained in:
parent
29219500b7
commit
1bb8555691
5 changed files with 80 additions and 31 deletions
20
wgpu/src/widget/canvas/text.rs
Normal file
20
wgpu/src/widget/canvas/text.rs
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
use iced_native::{Color, Font, HorizontalAlignment, Rectangle, VerticalAlignment};
|
||||
|
||||
/// A text node to be drawn to a canvas
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct TextNode {
|
||||
/// The contents of the text
|
||||
pub content: String,
|
||||
/// The bounds of the text
|
||||
pub bounds: Rectangle,
|
||||
/// The color of the text
|
||||
pub color: Color,
|
||||
/// The size of the text
|
||||
pub size: f32,
|
||||
/// The font of the text
|
||||
pub font: Font,
|
||||
/// The horizontal alignment of the text
|
||||
pub horizontal_alignment: HorizontalAlignment,
|
||||
/// The vertical alignment of the text
|
||||
pub vertical_alignment: VerticalAlignment,
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue