]> O.S.I.I.S - jp/vkvg.git/commitdiff
enable svg id test, works well with nsvg if subobjects have no id
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Thu, 2 May 2019 18:37:15 +0000 (20:37 +0200)
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Thu, 2 May 2019 18:37:15 +0000 (20:37 +0200)
src/vkvg_context.c
tests/svg.c

index d3e5b7ab8ae3071c37b7d800d1e388f9715f8612..b6c568f497a8fad9502bdf7eadf9a1f4857b49b1 100644 (file)
@@ -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);
 
index df3bef13e6693aeae1affa726e7de88b80526baf..f60380b3e056a008892b6ef427764b03bd5dd706 100644 (file)
@@ -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);