diff options
Diffstat (limited to '')
-rw-r--r-- | graphics/src/geometry.rs | 11 | ||||
-rw-r--r-- | graphics/src/geometry/path.rs | 2 |
2 files changed, 8 insertions, 5 deletions
diff --git a/graphics/src/geometry.rs b/graphics/src/geometry.rs index 8db1594a..1f3d2c01 100644 --- a/graphics/src/geometry.rs +++ b/graphics/src/geometry.rs @@ -16,10 +16,11 @@ pub use stroke::{LineCap, LineDash, LineJoin, Stroke}; pub use style::Style; pub use text::Text; -pub use iced_core::gradient::{self, Gradient}; +pub use crate::core::gradient::{self, Gradient}; use crate::Primitive; +/// A bunch of shapes that can be drawn. #[derive(Debug, Clone)] pub struct Geometry(pub Primitive); @@ -29,8 +30,8 @@ impl From<Geometry> for Primitive { } } -pub trait Renderer: iced_core::Renderer { - type Geometry; - - fn draw(&mut self, geometry: Vec<Self::Geometry>); +/// A renderer capable of drawing some [`Geometry`]. +pub trait Renderer: crate::core::Renderer { + /// Draws the given layers of [`Geometry`]. + fn draw(&mut self, layers: Vec<Geometry>); } diff --git a/graphics/src/geometry/path.rs b/graphics/src/geometry/path.rs index c3127bdf..3d8fc6fa 100644 --- a/graphics/src/geometry/path.rs +++ b/graphics/src/geometry/path.rs @@ -53,11 +53,13 @@ impl Path { Self::new(|p| p.circle(center, radius)) } + /// Returns the internal [`lyon_path::Path`]. #[inline] pub fn raw(&self) -> &lyon_path::Path { &self.raw } + /// Returns the current [`Path`] with the given transform applied to it. #[inline] pub fn transform(&self, transform: &lyon_path::math::Transform) -> Path { Path { |