Skip to content

Commit

Permalink
bugfix(plotters-rs#405): Fixed colinearity test for computation polyg…
Browse files Browse the repository at this point in the history
…on vertexes
  • Loading branch information
egordm authored and raldone01 committed Jan 8, 2023
1 parent fbf0993 commit 63a45c9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions plotters-backend/src/rasterizer/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ fn compute_polygon_vertex(triple: &[BackendCoord; 3], d: f64, buf: &mut Vec<Back
f64::from(triple[1].1) + d * b_n.1,
);

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

0 comments on commit 63a45c9

Please sign in to comment.