summaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
Diffstat (limited to 'crates')
-rw-r--r--crates/typst/src/visualize/shape.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/crates/typst/src/visualize/shape.rs b/crates/typst/src/visualize/shape.rs
index 4567739e..e37e5f90 100644
--- a/crates/typst/src/visualize/shape.rs
+++ b/crates/typst/src/visualize/shape.rs
@@ -1108,7 +1108,7 @@ impl ControlPoints {
+ 2.0 * (o.y - c_i.y).to_raw() * (c_i.y - c_o.y).to_raw();
let c = (c_i.x - c_o.x).to_raw().powi(2) + (c_i.y - c_o.y).to_raw().powi(2)
- r.to_raw().powi(2);
- let t = (-b + (b * b - 4.0 * a * c).sqrt()) / (2.0 * a);
+ let t = (-b + (b * b - 4.0 * a * c).max(0.0).sqrt()) / (2.0 * a);
c_i + t * (o - c_i)
}