mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-29 16:38:12 +08:00
Bezier-rs: Fix visualizing negative curvature on demo site
This commit is contained in:
@@ -232,7 +232,7 @@ impl WasmBezier {
|
|||||||
let intersection_point = self.0.evaluate(t);
|
let intersection_point = self.0.evaluate(t);
|
||||||
let normal_point = self.0.normal(t);
|
let normal_point = self.0.normal(t);
|
||||||
let curvature = self.0.curvature(t);
|
let curvature = self.0.curvature(t);
|
||||||
let content = if curvature < 0.000001 {
|
let content = if curvature.abs() < 0.000001 {
|
||||||
// Linear curve segment: the radius is infinite so we don't draw it
|
// Linear curve segment: the radius is infinite so we don't draw it
|
||||||
format!("{bezier}{}", draw_circle(intersection_point, 3., RED, 1., WHITE))
|
format!("{bezier}{}", draw_circle(intersection_point, 3., RED, 1., WHITE))
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -349,7 +349,7 @@ impl WasmSubpath {
|
|||||||
let intersection_point = self.0.evaluate(t);
|
let intersection_point = self.0.evaluate(t);
|
||||||
let normal_point = self.0.normal(t);
|
let normal_point = self.0.normal(t);
|
||||||
let curvature = self.0.curvature(t);
|
let curvature = self.0.curvature(t);
|
||||||
let content = if curvature < 0.000001 {
|
let content = if curvature.abs() < 0.000001 {
|
||||||
// Linear curve segment: the radius is infinite so we don't draw it
|
// Linear curve segment: the radius is infinite so we don't draw it
|
||||||
format!("{subpath}{}", draw_circle(intersection_point, 3., RED, 1., WHITE))
|
format!("{subpath}{}", draw_circle(intersection_point, 3., RED, 1., WHITE))
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user