Skip to content

Commit cfc7ca9

Browse files
committed
Fix 3 same point problem
1 parent b9ab4ae commit cfc7ca9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/chart/rendering/renderedchart.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,10 @@ Geom::ConvexQuad Marker::pointsToQuad(double atLeastWidth) const
7979
auto &&vector = points[nextIx] - points[ix];
8080
if (auto &&diff = vector.abs(); diff < atLeastWidth) {
8181
if (Math::Floating::is_zero(diff)) {
82+
const auto prevIx = (ix + 3) % 4;
8283
const auto nextNextIx = (nextIx + 1) % 4;
83-
vector = (points[nextNextIx] - points[nextIx])
84+
vector = (points[prevIx] - points[ix]).normal(false)
85+
+ (points[nextNextIx] - points[nextIx])
8486
.normal(false);
8587
}
8688
auto &&move =

0 commit comments

Comments
 (0)