diff options
author | 2024-01-31 19:42:38 +0100 | |
---|---|---|
committer | 2024-01-31 19:42:38 +0100 | |
commit | 66c8a804c6b665718a2cc80222ba8b906b543014 (patch) | |
tree | 5034f46b591dee2bc73b16d09a4711f23a69a236 /graphics/src/geometry/path/arc.rs | |
parent | 8ed3490280a4dd8a1d4e3cd421b1785725f65865 (diff) | |
parent | b1932989b0146c1957ba5bc8a4b8fc1bbf037975 (diff) | |
download | iced-66c8a804c6b665718a2cc80222ba8b906b543014.tar.gz iced-66c8a804c6b665718a2cc80222ba8b906b543014.tar.bz2 iced-66c8a804c6b665718a2cc80222ba8b906b543014.zip |
Merge pull request #2029 from ua-kxie/arc-and-ellipse-radians-type
use radians type in arc and ellipse
Diffstat (limited to 'graphics/src/geometry/path/arc.rs')
-rw-r--r-- | graphics/src/geometry/path/arc.rs | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/graphics/src/geometry/path/arc.rs b/graphics/src/geometry/path/arc.rs index dd4fcf33..2600497f 100644 --- a/graphics/src/geometry/path/arc.rs +++ b/graphics/src/geometry/path/arc.rs @@ -1,5 +1,5 @@ //! Build and draw curves. -use iced_core::{Point, Vector}; +use iced_core::{Point, Radians, Vector}; /// A segment of a differentiable curve. #[derive(Debug, Clone, Copy)] @@ -8,10 +8,10 @@ pub struct Arc { pub center: Point, /// The radius of the arc. pub radius: f32, - /// 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 in radians, clockwise rotation from positive x-axis. - pub end_angle: f32, + /// The start of the segment's angle, clockwise rotation from positive x-axis. + pub start_angle: Radians, + /// The end of the segment's angle, clockwise rotation from positive x-axis. + pub end_angle: Radians, } /// An elliptical [`Arc`]. @@ -22,11 +22,11 @@ pub struct Elliptical { /// 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 clockwise rotation of the arc's ellipse. - pub rotation: f32, - /// 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 in radians, clockwise rotation from positive x-axis. - pub end_angle: f32, + pub rotation: Radians, + /// The start of the segment's angle, clockwise rotation from positive x-axis. + pub start_angle: Radians, + /// The end of the segment's angle, clockwise rotation from positive x-axis. + pub end_angle: Radians, } impl From<Arc> for Elliptical { @@ -34,7 +34,7 @@ impl From<Arc> for Elliptical { Elliptical { center: arc.center, radii: Vector::new(arc.radius, arc.radius), - rotation: 0.0, + rotation: Radians(0.0), start_angle: arc.start_angle, end_angle: arc.end_angle, } |