summaryrefslogtreecommitdiffstats
path: root/graphics/src/geometry/path/builder.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón <hector@hecrj.dev>2024-01-31 19:42:38 +0100
committerLibravatar GitHub <noreply@github.com>2024-01-31 19:42:38 +0100
commit66c8a804c6b665718a2cc80222ba8b906b543014 (patch)
tree5034f46b591dee2bc73b16d09a4711f23a69a236 /graphics/src/geometry/path/builder.rs
parent8ed3490280a4dd8a1d4e3cd421b1785725f65865 (diff)
parentb1932989b0146c1957ba5bc8a4b8fc1bbf037975 (diff)
downloadiced-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/builder.rs')
-rw-r--r--graphics/src/geometry/path/builder.rs14
1 files changed, 8 insertions, 6 deletions
diff --git a/graphics/src/geometry/path/builder.rs b/graphics/src/geometry/path/builder.rs
index b0959fbf..1ccd83f2 100644
--- a/graphics/src/geometry/path/builder.rs
+++ b/graphics/src/geometry/path/builder.rs
@@ -1,6 +1,6 @@
use crate::geometry::path::{arc, Arc, Path};
-use iced_core::{Point, Size};
+use iced_core::{Point, Radians, Size};
use lyon_path::builder::{self, SvgPathBuilder};
use lyon_path::geom;
@@ -106,9 +106,11 @@ impl Builder {
let arc = geom::Arc {
center: math::Point::new(arc.center.x, arc.center.y),
radii: math::Vector::new(arc.radii.x, arc.radii.y),
- x_rotation: math::Angle::radians(arc.rotation),
- start_angle: math::Angle::radians(arc.start_angle),
- sweep_angle: math::Angle::radians(arc.end_angle - arc.start_angle),
+ x_rotation: math::Angle::radians(arc.rotation.0),
+ start_angle: math::Angle::radians(arc.start_angle.0),
+ sweep_angle: math::Angle::radians(
+ (arc.end_angle - arc.start_angle).0,
+ ),
};
let _ = self.raw.move_to(arc.sample(0.0));
@@ -165,8 +167,8 @@ impl Builder {
self.arc(Arc {
center,
radius,
- start_angle: 0.0,
- end_angle: 2.0 * std::f32::consts::PI,
+ start_angle: Radians(0.0),
+ end_angle: Radians(2.0 * std::f32::consts::PI),
});
}