summaryrefslogtreecommitdiffstats
path: root/native/src/renderer.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2021-11-04 19:22:29 +0700
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2021-11-04 19:24:11 +0700
commit023aded2772f0cd6abd716fe5c8624d5d22e21fa (patch)
tree1bdb1a4584d7acc688b081a299bb4431cd35c349 /native/src/renderer.rs
parent343f9b7e2e594bd1fef1ed511d71e81f9c44e3d9 (diff)
downloadiced-023aded2772f0cd6abd716fe5c8624d5d22e21fa.tar.gz
iced-023aded2772f0cd6abd716fe5c8624d5d22e21fa.tar.bz2
iced-023aded2772f0cd6abd716fe5c8624d5d22e21fa.zip
Rename `fill_rectangle` to `fill_quad` in `Renderer`
Diffstat (limited to 'native/src/renderer.rs')
-rw-r--r--native/src/renderer.rs9
1 files changed, 7 insertions, 2 deletions
diff --git a/native/src/renderer.rs b/native/src/renderer.rs
index 1e518936..3b04a5c0 100644
--- a/native/src/renderer.rs
+++ b/native/src/renderer.rs
@@ -42,23 +42,28 @@ pub trait Renderer: Sized {
element.layout(self, limits)
}
+ /// Draws the primitives recorded in the given closure in a new layer.
+ ///
+ /// The layer will clip its contents to the provided `bounds`.
fn with_layer(&mut self, bounds: Rectangle, f: impl FnOnce(&mut Self));
+ /// Applies a `translation` to the primitives recorded in the given closure.
fn with_translation(
&mut self,
translation: Vector,
f: impl FnOnce(&mut Self),
);
+ /// Clears all of the recorded primitives in the [`Renderer`].
fn clear(&mut self);
- fn fill_rectangle(&mut self, quad: Quad);
+ /// Fills a [`Quad`] with the provided [`Background`].
+ fn fill_quad(&mut self, quad: Quad, background: impl Into<Background>);
}
#[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,