summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorFederico Mena Quintero <federico@gnome.org>2019-10-22 10:51:18 -0500
committerFederico Mena Quintero <federico@gnome.org>2019-10-22 11:13:33 -0500
commit58e9f27ecb825d8697718dc4f71ee73dab19cc86 (patch)
treef6f26e3cad66b40a54931abb3277b688f0550520 /tests
parent57c2a2e8ac23f49f5470af5f64ce4c661f5cbb2d (diff)
downloadlibrsvg-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.c7
-rw-r--r--tests/fixtures/dimensions/521-with-viewbox.svg4
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>