Commit 96fd9eda authored by Florian Blasius's avatar Florian Blasius 🤘
Browse files

impl into box for render objects.

parent a41df436
Pipeline #2435 passed with stage
in 8 minutes and 12 seconds
......@@ -12,6 +12,12 @@ pub struct Image {
pub index: usize,
}
impl Into<Box<RenderObject>> for Image {
fn into(self) -> Box<RenderObject> {
Box::new(self)
}
}
impl Image {
/// Sets the `size` of the image.
pub fn with_source<S: Into<String>>(mut self, source: S) -> Self {
......
......@@ -14,6 +14,12 @@ pub struct Rectangle {
pub position: Point,
}
impl Into<Box<RenderObject>> for Rectangle {
fn into(self) -> Box<RenderObject> {
Box::new(self)
}
}
impl Rectangle {
/// Sets the `background` color of the rectangle.
pub fn with_background(mut self, background: Color) -> Self {
......
......@@ -12,6 +12,12 @@ pub struct Text {
pub position: Point,
}
impl Into<Box<RenderObject>> for Text {
fn into(self) -> Box<RenderObject> {
Box::new(self)
}
}
impl Text {
/// Sets the `foreground` color of the text.
pub fn with_foreground(mut self, foreground: Color) -> Self {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment