From 6aae494cbbf77b24d577e74c507912de97737886 Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Thu, 16 Jun 2022 17:32:08 -0700 Subject: [PATCH] fix: in SVG output, set opacity 0 for text with 0 alpha value Gitlab: fixes #146 --- CHANGELOG.md | 1 + plugin/core/gvrender_core_svg.c | 2 +- tests/test_regression.py | 1 - 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a60151980..652afa385 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Failed assertion in `chkSgraph` for dot layout and ortho splines. #1408 - Failed assertion in `chkSgraph` for circo layout and ortho splines. #1990 - Segmentation Fault with splines="ortho". #1658 +- Transparent Label appear in SVG output #146 ## [4.0.0] – 2022-05-29 diff --git a/plugin/core/gvrender_core_svg.c b/plugin/core/gvrender_core_svg.c index 97d9204b7..6c1a65223 100644 --- a/plugin/core/gvrender_core_svg.c +++ b/plugin/core/gvrender_core_svg.c @@ -463,7 +463,7 @@ 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) + if (obj->pencolor.u.rgba[3] < 255) gvprintf(job, " fill-opacity=\"%f\"", ((float) obj->pencolor.u.rgba[3] / 255.0)); break; default: diff --git a/tests/test_regression.py b/tests/test_regression.py index 0a0c60f2a..96456e63b 100644 --- a/tests/test_regression.py +++ b/tests/test_regression.py @@ -173,7 +173,6 @@ def test_144(testcase: str): # this should be consistent with the direction the edge is drawn assert routed_up == head_is_top, "heap/tail confusion" -@pytest.mark.xfail(strict=True) def test_146(): """ dot should respect an alpha channel value of 0 when writing SVG -- 2.40.0