render: common -> update calculation of coefficient resource

* overcome lint error
Signed-off-by: default avatarRalf Zerres <ralf.zerres@networkx.de>
parent da473ce6
......@@ -68,7 +68,9 @@ pub fn cubic_bezier_rect(p0: Point, p1: Point, p2: Point, p3: Point) -> Rectangl
let coefficient_b = 1.0 * p0 - 2.0 * p1 + 1.0 * p2;
let coefficient_a = -1.0 * p0 + 3.0 * p1 - 3.0 * p2 + 1.0 * p3;
let res = coefficient_b * coefficient_b - coefficient_a * coefficient_c;
// let res = coefficient_b * coefficient_b - coefficient_a * coefficient_c;
let mut res = coefficient_b * coefficient_b;
res = res - coefficient_a * coefficient_c;
if res.x() > 0.0 || res.y() > 0.0 {
// The control point is outside of the ends rectangle, possibly the AABB of the curve is larger.
let sqrt = res.abs().sqrt();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment