From: Jean-Philippe Bruyère Date: Thu, 2 May 2019 18:37:15 +0000 (+0200) Subject: enable svg id test, works well with nsvg if subobjects have no id X-Git-Tag: v0.1-alpha~78 X-Git-Url: https://git.osiis.dedyn.io/?a=commitdiff_plain;h=7443a23c3a7f4fd2d51094b4ae884e8a5fe1633b;p=jp%2Fvkvg.git enable svg id test, works well with nsvg if subobjects have no id --- diff --git a/src/vkvg_context.c b/src/vkvg_context.c index d3e5b7a..b6c568f 100644 --- a/src/vkvg_context.c +++ b/src/vkvg_context.c @@ -880,10 +880,10 @@ void vkvg_render_svg (VkvgContext ctx, NSVGimage* svg, char *subId){ vkvg_set_source_rgba(ctx,0.0,0.0,0.0,1); for (shape = svg->shapes; shape != NULL; shape = shape->next) { - /*if (subId != NULL) { + if (subId != NULL) { if (strcmp(shape->id, subId)!=0) continue; - }*/ + } vkvg_new_path(ctx); diff --git a/tests/svg.c b/tests/svg.c index df3bef1..f60380b 100644 --- a/tests/svg.c +++ b/tests/svg.c @@ -13,7 +13,6 @@ void _svg_set_color (VkvgContext ctx, uint32_t c, float alpha) { } static float rotation = 0.f; -//static const char* path = "/mnt/devel/crow-drm/Images/Icons/expandable.svg"; static const char* path = "data/tiger.svg"; void test_svg_surface() { @@ -40,6 +39,7 @@ void test_nsvg() { vkvg_scale(ctx,0.3f,0.3f); vkvg_render_svg(ctx, svg, NULL); + vkvg_destroy(ctx); nsvg_destroy(svg);