From 73fe8ac65d53c9bb9780cd9c8fbfbf1ae8b94b8f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jean-Philippe=20Bruy=C3=A8re?= Date: Sat, 21 Apr 2018 04:41:01 +0200 Subject: [PATCH] debug fill when multiple subpath, code cleaning required --- src/vkvg_context.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/vkvg_context.c b/src/vkvg_context.c index 2eac1ea..a6d6abe 100644 --- a/src/vkvg_context.c +++ b/src/vkvg_context.c @@ -349,15 +349,17 @@ void vkvg_fill_preserve (VkvgContext ctx){ ptrPath+=2; continue; } + uint32_t firstPtIdx = ctx->pathes[ptrPath]; lastPathPointIdx = _get_last_point_of_closed_path (ctx, ptrPath); uint32_t pathPointCount = lastPathPointIdx - ctx->pathes[ptrPath] + 1; uint32_t firstVertIdx = ctx->vertCount; ear_clip_point ecps[pathPointCount]; uint32_t ecps_count = pathPointCount; + i = 0; - while (i < lastPathPointIdx){ - v.pos = ctx->points[i]; + while (i < pathPointCount-1){ + v.pos = ctx->points[i+firstPtIdx]; ear_clip_point ecp = { v.pos, i+firstVertIdx, @@ -367,7 +369,7 @@ void vkvg_fill_preserve (VkvgContext ctx){ _add_vertex(ctx, v); i++; } - v.pos = ctx->points[i]; + v.pos = ctx->points[i+firstPtIdx]; ear_clip_point ecp = { v.pos, i+firstVertIdx, -- 2.47.3