diff options
| author | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2021-12-20 09:39:19 +0100 |
|---|---|---|
| committer | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2021-12-20 09:39:19 +0100 |
| commit | 58d87df0002fc54e9c3252f2b8d8531bf959654c (patch) | |
| tree | 0fe4cb20771a4cc7e2eeb33db7f76719723c1d08 /src | |
| parent | 2621081946b76e940b7af73ec7f91a8924287fa0 (diff) | |
rlh only if dot < 0
Diffstat (limited to 'src')
| -rw-r--r-- | src/vkvg_context_internal.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/vkvg_context_internal.c b/src/vkvg_context_internal.c index 65a5dec..ddc120e 100644 --- a/src/vkvg_context_internal.c +++ b/src/vkvg_context_internal.c @@ -795,7 +795,9 @@ bool _build_vb_step (vkvg_context* ctx, float hw, stroke_context_t* str, bool is vec2 bisec_n_perp = vec2_perp(bisec_n); //limit bisectrice length - float rlh = fminf (lh, fminf (length_v0, length_v1)); + float rlh = lh; + if (dot<0.f) + rlh = fminf (rlh, fminf (length_v0, length_v1)); //--- vec2 bisec = vec2_mult_s (bisec_n_perp, rlh); @@ -804,7 +806,7 @@ bool _build_vb_step (vkvg_context* ctx, float hw, stroke_context_t* str, bool is vec2 rlh_inside_pos; - if (rlh < lh || ctx->lineJoin != VKVG_LINE_JOIN_MITER) { + if (!isCurve && (rlh < lh || ctx->lineJoin != VKVG_LINE_JOIN_MITER)) { vec2 vnPerp; if (length_v0 < length_v1) vnPerp = vec2_perp (v1n); @@ -819,7 +821,7 @@ bool _build_vb_step (vkvg_context* ctx, float hw, stroke_context_t* str, bool is } if (ctx->lineJoin == VKVG_LINE_JOIN_MITER || isCurve){ - if (dot < 0.f && rlh < lh) { + if (!isCurve && dot < 0.f && rlh < lh) { double x = (lh - rlh) * cosf (halfAlpha); vec2 bisecPerp = vec2_mult_s (bisec_n, x); vec2 p = vec2_add(p0, bisec); |