Implement Default for canvas::Text

This commit is contained in:
Héctor Ramón Jiménez 2020-03-08 00:06:48 +01:00
parent e9194cbf4a
commit b4f970ee73

View File

@ -18,3 +18,17 @@ pub struct Text {
/// The vertical alignment of the text
pub vertical_alignment: VerticalAlignment,
}
impl Default for Text {
fn default() -> Text {
Text {
content: String::new(),
position: Point::ORIGIN,
color: Color::BLACK,
size: 16.0,
font: Font::Default,
horizontal_alignment: HorizontalAlignment::Left,
vertical_alignment: VerticalAlignment::Top,
}
}
}