Skip to content

Commit 310a107

Browse files
egordm38
authored andcommitted
bugfix(#405): Fixed colinearity test for computation polygon vertexes
1 parent 7f8b12d commit 310a107

File tree

1 file changed

+2
-2
lines changed
  • plotters-backend/src/rasterizer

1 file changed

+2
-2
lines changed

plotters-backend/src/rasterizer/path.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ fn compute_polygon_vertex(triple: &[BackendCoord; 3], d: f64, buf: &mut Vec<Back
3434
f64::from(triple[1].1) + d * b_n.1,
3535
);
3636

37-
// If they are actually the same point, then the 3 points are colinear, so just emit the point.
38-
if a_p.0 as i32 == b_p.0 as i32 && a_p.1 as i32 == b_p.1 as i32 {
37+
// Check if 3 points are colinear. If so, just emit the point.
38+
if a_t.1 * b_t.0 == a_t.0 * b_t.1 {
3939
buf.push((a_p.0 as i32, a_p.1 as i32));
4040
return;
4141
}

0 commit comments

Comments
 (0)