diff options
author | 2023-05-11 15:25:58 +0200 | |
---|---|---|
committer | 2023-05-11 15:25:58 +0200 | |
commit | 8622e998f2701e7f4ca8d2f71c85150f436a9945 (patch) | |
tree | de62eead3db44002997b83849711533b214aae31 /graphics/src/geometry | |
parent | dd04c0b070b60b15293892e2a7c284787d3d63b1 (diff) | |
download | iced-8622e998f2701e7f4ca8d2f71c85150f436a9945.tar.gz iced-8622e998f2701e7f4ca8d2f71c85150f436a9945.tar.bz2 iced-8622e998f2701e7f4ca8d2f71c85150f436a9945.zip |
Write missing documentation in `iced_graphics`
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 { |