diff options
author | Federico Mena Quintero <federico@gnome.org> | 2019-10-22 10:51:18 -0500 |
---|---|---|
committer | Federico Mena Quintero <federico@gnome.org> | 2019-10-22 11:13:33 -0500 |
commit | 58e9f27ecb825d8697718dc4f71ee73dab19cc86 (patch) | |
tree | f6f26e3cad66b40a54931abb3277b688f0550520 /tests | |
parent | 57c2a2e8ac23f49f5470af5f64ce4c661f5cbb2d (diff) | |
download | librsvg-58e9f27ecb825d8697718dc4f71ee73dab19cc86.tar.gz |
(#521): Compute geometries correctly if there is a viewBox attribute
Commit a2b34631 broke geometry computation of elements when the
toplevel SVG has a viewBox attribute.
Every time we change the matrix to draw, we need to retransform the
drawings's resulting bbox to the original matrix.
Fixes https://gitlab.gnome.org/GNOME/librsvg/issues/521
Diffstat (limited to 'tests')
-rw-r--r-- | tests/dimensions.c | 7 | ||||
-rw-r--r-- | tests/fixtures/dimensions/521-with-viewbox.svg | 4 |
2 files changed, 11 insertions, 0 deletions
diff --git a/tests/dimensions.c b/tests/dimensions.c index b070b22f..186d66ad 100644 --- a/tests/dimensions.c +++ b/tests/dimensions.c @@ -113,6 +113,13 @@ static FixtureData fixtures[] = 80, 48.90, 0, 0, TRUE, FALSE }, + { + "/dimensions/with-viewbox", + "dimensions/521-with-viewbox.svg", + "#foo", + 50.0, 60.0, 70.0, 80.0, + TRUE, TRUE + }, }; static const gint n_fixtures = G_N_ELEMENTS (fixtures); diff --git a/tests/fixtures/dimensions/521-with-viewbox.svg b/tests/fixtures/dimensions/521-with-viewbox.svg new file mode 100644 index 00000000..c3f34e6d --- /dev/null +++ b/tests/fixtures/dimensions/521-with-viewbox.svg @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="UTF-8"?> +<svg width="200" height="100" viewBox="0 0 2000 1000"> + <rect id="foo" x="500" y="600" width="700" height="800"/> +</svg> |