mirror of
https://github.com/thorvg/thorvg.git
synced 2025-07-27 00:26:51 +00:00
wg_engine: fix vertices while line joining
Vertex ordering during line join needed adjustment. Vertices were forming two partialy overlapping triangles instead of a rectangle. The issue was rarely visible since the resulting rectangle often overlapped significantly with other rectangles.
This commit is contained in:
parent
915acd2ec3
commit
8acb135cb0
1 changed files with 2 additions and 2 deletions
|
@ -336,7 +336,7 @@ void WgGeometryData::appendStrokeJoin(const WgPoint& v0, const WgPoint& v1, cons
|
|||
if (join == StrokeJoin::Round) {
|
||||
appendCircle(v1, halfWidth);
|
||||
} else if (join == StrokeJoin::Bevel) {
|
||||
appendRect(v1 - offset0, v1 + offset0, v1 - offset1, v1 + offset1);
|
||||
appendRect(v1 - offset0, v1 + offset1, v1 - offset1, v1 + offset0);
|
||||
} else if (join == StrokeJoin::Miter) {
|
||||
WgPoint nrm = (nrm0 + nrm1);
|
||||
if (!tvg::zero(dir0.x * dir1.y - dir0.y * dir1.x)) {
|
||||
|
@ -348,7 +348,7 @@ void WgGeometryData::appendStrokeJoin(const WgPoint& v0, const WgPoint& v1, cons
|
|||
appendRect(v1 + nrm * (halfWidth / cosine), v1 + offset0, v1 + offset1, v1);
|
||||
appendRect(v1 - nrm * (halfWidth / cosine), v1 - offset0, v1 - offset1, v1);
|
||||
} else {
|
||||
appendRect(v1 - offset0, v1 + offset0, v1 - offset1, v1 + offset1);
|
||||
appendRect(v1 - offset0, v1 + offset1, v1 - offset1, v1 + offset0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue