From 76ffbbd06e53e2793cba7f7e640279b1f6ef1b12 Mon Sep 17 00:00:00 2001 From: Kxie <56177821+ua-kxie@users.noreply.github.com> Date: Mon, 7 Aug 2023 17:35:26 +0800 Subject: Update arc.rs with improved documentation added units and improved description to field comments of Arc and Ellipse structs. --- graphics/src/geometry/path/arc.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'graphics/src/geometry') 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, } -- cgit From ed3454301e663a7cb7d73cd56b57b188f4d14a2f Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Wed, 30 Aug 2023 04:31:21 +0200 Subject: Implement explicit text caching in the widget state tree --- graphics/src/geometry/text.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'graphics/src/geometry') 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, -- cgit From 419d9374b79b39293ba9a17967c2356d29377d8f Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Sat, 9 Sep 2023 21:08:23 +0200 Subject: Fix outstanding broken intradoc links --- graphics/src/geometry/fill.rs | 4 +++- graphics/src/geometry/stroke.rs | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'graphics/src/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/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; -- cgit From 34f07b60273d6cfe13834af54cd0e24d34569387 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Wed, 20 Sep 2023 04:11:52 +0200 Subject: Fix `clippy::semicolon_if_nothing_returned` --- graphics/src/geometry/path/builder.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'graphics/src/geometry') 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`]. -- cgit