diff options
author | 2021-10-18 14:47:49 +0700 | |
---|---|---|
committer | 2021-10-18 14:47:49 +0700 | |
commit | a4f4d831615899046d36c96e6a580d5386aa25bf (patch) | |
tree | 3b589d57778b7e62584aa2b5832dd3f81b2a8717 /native/src/renderer.rs | |
parent | dfceee99aad9462f09ca61081e68e1decb2fed92 (diff) | |
download | iced-a4f4d831615899046d36c96e6a580d5386aa25bf.tar.gz iced-a4f4d831615899046d36c96e6a580d5386aa25bf.tar.bz2 iced-a4f4d831615899046d36c96e6a580d5386aa25bf.zip |
Introduce `fill_rectangle` to `Renderer` trait
Diffstat (limited to 'native/src/renderer.rs')
-rw-r--r-- | native/src/renderer.rs | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/native/src/renderer.rs b/native/src/renderer.rs index 5a7a0067..382edb61 100644 --- a/native/src/renderer.rs +++ b/native/src/renderer.rs @@ -29,7 +29,7 @@ mod null; pub use null::Null; use crate::layout; -use crate::{Element, Rectangle, Vector}; +use crate::{Background, Color, Element, Rectangle, Vector}; /// A component that can take the state of a user interface and produce an /// output for its users. @@ -59,4 +59,15 @@ pub trait Renderer: Sized { ); fn clear(&mut self); + + fn fill_rectangle(&mut self, quad: Quad); +} + +#[derive(Debug, Clone, Copy, PartialEq)] +pub struct Quad { + pub bounds: Rectangle, + pub background: Background, + pub border_radius: f32, + pub border_width: f32, + pub border_color: Color, } |