Skip to content
Permalink
Browse files

Make arc() wrap angles mod 2pi

  • Loading branch information
pylbrecht committed Dec 2, 2019
1 parent 02e3325 commit a02daef7b29a796a736e97d39f9c389b2d4bd70a
Showing with 8 additions and 1 deletion.
  1. +8 −1 components/canvas/raqote_backend.rs
@@ -488,10 +488,17 @@ impl GenericPathBuilder for PathBuilder {
&mut self,
origin: Point2D<f32>,
radius: f32,
start_angle: f32,
mut start_angle: f32,
mut end_angle: f32,
anticlockwise: bool,
) {
if (!anticlockwise && start_angle > end_angle + 2. * PI) ||
(anticlockwise && end_angle > start_angle + 2. * PI)
{
start_angle = start_angle % (2. * PI);
end_angle = end_angle % (2. * PI);
}

if (anticlockwise && end_angle > 0.) || (!anticlockwise && end_angle < 0.) {
end_angle = -end_angle;
}

0 comments on commit a02daef

Please sign in to comment.
You can’t perform that action at this time.