diff options
| author | Tomás Cruz <103905440+Tom4sCruz@users.noreply.github.com> | 2024-04-06 12:21:38 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-04-06 11:21:38 +0000 |
| commit | 5de36f7b97c237ad0fc4a0b4ccecd7adcb43181b (patch) | |
| tree | e4466d2ec0949ea9e2d44580942b2f0deb48003f /crates | |
| parent | 3d4de954aaeb072a1df2bedf7f93785b3498bc69 (diff) | |
Deformed stroke for some length values fix (#3860)
Diffstat (limited to 'crates')
| -rw-r--r-- | crates/typst/src/visualize/shape.rs | 2 |
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) } |
