Skip to content

Commit

Permalink
Fix 3 same point problem
Browse files Browse the repository at this point in the history
  • Loading branch information
schaumb committed Aug 6, 2024
1 parent b9ab4ae commit cfc7ca9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/chart/rendering/renderedchart.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,10 @@ Geom::ConvexQuad Marker::pointsToQuad(double atLeastWidth) const
auto &&vector = points[nextIx] - points[ix];
if (auto &&diff = vector.abs(); diff < atLeastWidth) {
if (Math::Floating::is_zero(diff)) {
const auto prevIx = (ix + 3) % 4;
const auto nextNextIx = (nextIx + 1) % 4;
vector = (points[nextNextIx] - points[nextIx])
vector = (points[prevIx] - points[ix]).normal(false)
+ (points[nextNextIx] - points[nextIx])
.normal(false);
}
auto &&move =
Expand Down

0 comments on commit cfc7ca9

Please sign in to comment.