From 18827f62de1f208eb78d521fb3e82a5cae4e841c Mon Sep 17 00:00:00 2001 From: Stephen C North Date: Mon, 6 Dec 2021 08:37:08 -0500 Subject: [PATCH] Fixes https://gitlab.com/graphviz/graphviz/-/issues/1855 where the SVG view setup needs more than two digits of precision, otherwise clipping may result. --- plugin/core/gvrender_core_svg.c | 5 ++--- rtest/test_regression.py | 1 - 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/plugin/core/gvrender_core_svg.c b/plugin/core/gvrender_core_svg.c index 0fef81c45..f02770a27 100644 --- a/plugin/core/gvrender_core_svg.c +++ b/plugin/core/gvrender_core_svg.c @@ -251,9 +251,8 @@ static void svg_begin_page(GVJ_t * job) * and it is the entire graph if we're not currently paging */ svg_print_id_class(job, obj->id, NULL, "graph", obj->u.g); GVPUTS(job, " transform=\"scale("); - gvprintdouble(job, job->scale.x); - GVPUTS(job, " "); - gvprintdouble(job, job->scale.y); + // cannot be gvprintdouble because 2 digits precision insufficient + gvprintf(job, "%g %g", job->scale.x, job->scale.y); gvprintf(job, ") rotate(%d) translate(", -job->rotation); gvprintdouble(job, job->translation.x); GVPUTS(job, " "); diff --git a/rtest/test_regression.py b/rtest/test_regression.py index f8abf5d01..0a29050a5 100644 --- a/rtest/test_regression.py +++ b/rtest/test_regression.py @@ -832,7 +832,6 @@ def test_html(src: Path): assert p.returncode == 0 assert stderr == "" -@pytest.mark.xfail(strict=True) def test_1855(): """ SVGs should have a scale with sufficient precision -- 2.40.0