diff options
Diffstat (limited to '')
| -rw-r--r-- | graphics/src/geometry.rs | 4 | ||||
| -rw-r--r-- | graphics/src/geometry/fill.rs | 4 | ||||
| -rw-r--r-- | graphics/src/geometry/path/arc.rs | 12 | ||||
| -rw-r--r-- | graphics/src/geometry/path/builder.rs | 2 | ||||
| -rw-r--r-- | graphics/src/geometry/stroke.rs | 4 | ||||
| -rw-r--r-- | graphics/src/geometry/text.rs | 6 | 
6 files changed, 18 insertions, 14 deletions
| diff --git a/graphics/src/geometry.rs b/graphics/src/geometry.rs index 7cd3dd3a..d7d6a0aa 100644 --- a/graphics/src/geometry.rs +++ b/graphics/src/geometry.rs @@ -14,11 +14,11 @@ pub use text::Text;  pub use crate::gradient::{self, Gradient}; -/// A renderer capable of drawing some [`Geometry`]. +/// A renderer capable of drawing some [`Self::Geometry`].  pub trait Renderer: crate::core::Renderer {      /// The kind of geometry this renderer can draw.      type Geometry; -    /// Draws the given layers of [`Geometry`]. +    /// Draws the given layers of [`Self::Geometry`].      fn draw(&mut self, layers: Vec<Self::Geometry>);  } diff --git a/graphics/src/geometry/fill.rs b/graphics/src/geometry/fill.rs index b773c99b..670fbc12 100644 --- a/graphics/src/geometry/fill.rs +++ b/graphics/src/geometry/fill.rs @@ -1,4 +1,6 @@ -//! Fill [crate::widget::canvas::Geometry] with a certain style. +//! Fill [`Geometry`] with a certain style. +//! +//! [`Geometry`]: super::Renderer::Geometry  pub use crate::geometry::Style;  use crate::core::Color; diff --git a/graphics/src/geometry/path/arc.rs b/graphics/src/geometry/path/arc.rs index 2cdebb66..dd4fcf33 100644 --- a/graphics/src/geometry/path/arc.rs +++ b/graphics/src/geometry/path/arc.rs @@ -8,9 +8,9 @@ pub struct Arc {      pub center: Point,      /// The radius of the arc.      pub radius: f32, -    /// The start of the segment's angle, clockwise rotation. +    /// The start of the segment's angle in radians, clockwise rotation from positive x-axis.      pub start_angle: f32, -    /// The end of the segment's angle, clockwise rotation. +    /// The end of the segment's angle in radians, clockwise rotation from positive x-axis.      pub end_angle: f32,  } @@ -19,13 +19,13 @@ pub struct Arc {  pub struct Elliptical {      /// The center of the arc.      pub center: Point, -    /// The radii of the arc's ellipse, defining its axes. +    /// The radii of the arc's ellipse. The horizontal and vertical half-dimensions of the ellipse will match the x and y values of the radii vector.      pub radii: Vector, -    /// The rotation of the arc's ellipse. +    /// The clockwise rotation of the arc's ellipse.      pub rotation: f32, -    /// The start of the segment's angle, clockwise rotation. +    /// The start of the segment's angle in radians, clockwise rotation from positive x-axis.      pub start_angle: f32, -    /// The end of the segment's angle, clockwise rotation. +    /// The end of the segment's angle in radians, clockwise rotation from positive x-axis.      pub end_angle: f32,  } diff --git a/graphics/src/geometry/path/builder.rs b/graphics/src/geometry/path/builder.rs index 794dd3bc..b0959fbf 100644 --- a/graphics/src/geometry/path/builder.rs +++ b/graphics/src/geometry/path/builder.rs @@ -174,7 +174,7 @@ impl Builder {      /// the starting point.      #[inline]      pub fn close(&mut self) { -        self.raw.close() +        self.raw.close();      }      /// Builds the [`Path`] of this [`Builder`]. diff --git a/graphics/src/geometry/stroke.rs b/graphics/src/geometry/stroke.rs index 69a76e1c..aff49ab3 100644 --- a/graphics/src/geometry/stroke.rs +++ b/graphics/src/geometry/stroke.rs @@ -1,4 +1,6 @@ -//! Create lines from a [crate::widget::canvas::Path] and assigns them various attributes/styles. +//! Create lines from a [`Path`] and assigns them various attributes/styles. +//! +//! [`Path`]: super::Path  pub use crate::geometry::Style;  use iced_core::Color; diff --git a/graphics/src/geometry/text.rs b/graphics/src/geometry/text.rs index c584f3cd..0bf7ec97 100644 --- a/graphics/src/geometry/text.rs +++ b/graphics/src/geometry/text.rs @@ -1,6 +1,6 @@  use crate::core::alignment;  use crate::core::text::{LineHeight, Shaping}; -use crate::core::{Color, Font, Point}; +use crate::core::{Color, Font, Pixels, Point};  /// A bunch of text that can be drawn to a canvas  #[derive(Debug, Clone)] @@ -19,7 +19,7 @@ pub struct Text {      /// The color of the text      pub color: Color,      /// The size of the text -    pub size: f32, +    pub size: Pixels,      /// The line height of the text.      pub line_height: LineHeight,      /// The font of the text @@ -38,7 +38,7 @@ impl Default for Text {              content: String::new(),              position: Point::ORIGIN,              color: Color::BLACK, -            size: 16.0, +            size: Pixels(16.0),              line_height: LineHeight::Relative(1.2),              font: Font::default(),              horizontal_alignment: alignment::Horizontal::Left, | 
