]> granicus.if.org Git - graphviz/commitdiff
Support opacity in svg fonts. Issue #1217.
authorEmden Gansner <emdenrg@google.com>
Thu, 23 Mar 2017 18:42:21 +0000 (14:42 -0400)
committerEmden Gansner <emdenrg@google.com>
Thu, 23 Mar 2017 18:42:21 +0000 (14:42 -0400)
plugin/core/gvrender_core_svg.c

index 632e33c9002ff4f9c04bc1b1db0569cd5d995479..a24b5336528177c25461fdbe85d2d7424cc570fc 100644 (file)
@@ -481,6 +481,8 @@ static void svg_textspan(GVJ_t * job, pointf p, textspan_t * span)
        gvprintf(job, " fill=\"#%02x%02x%02x\"",
                 obj->pencolor.u.rgba[0], obj->pencolor.u.rgba[1],
                 obj->pencolor.u.rgba[2]);
+       if (obj->pencolor.u.rgba[3] > 0 && obj->pencolor.u.rgba[3] < 255)
+           gvprintf(job, " fill-opacity=\"%f\"", ((float) obj->pencolor.u.rgba[3] / 255.0));
        break;
     default:
        assert(0);              /* internal error */