diff --git a/gtk/gtkroundedbox.c b/gtk/gtkroundedbox.c
index c3e2650e4c..c89a1fd354 100644
--- a/gtk/gtkroundedbox.c
+++ b/gtk/gtkroundedbox.c
@@ -149,8 +149,10 @@ gtk_css_border_radius_grow (GtkRoundedBoxCorner *corner,
double horizontal,
double vertical)
{
- corner->horizontal += horizontal;
- corner->vertical += vertical;
+ if (corner->horizontal)
+ corner->horizontal += horizontal;
+ if (corner->vertical)
+ corner->vertical += vertical;
if (corner->horizontal <= 0 || corner->vertical <= 0)
{
diff --git a/testsuite/reftests/Makefile.am b/testsuite/reftests/Makefile.am
index 0b39b41dfd..103b523fde 100644
--- a/testsuite/reftests/Makefile.am
+++ b/testsuite/reftests/Makefile.am
@@ -143,6 +143,9 @@ testdata = \
box-shadow-spec-inset.css \
box-shadow-spec-inset.ref.ui \
box-shadow-spec-inset.ui \
+ box-shadow-spread.css \
+ box-shadow-spread.ref.ui \
+ box-shadow-spread.ui \
button-wrapping.ui \
button-wrapping.ref.ui \
cellrenderer-pixbuf-stock-rtl.css \
diff --git a/testsuite/reftests/box-shadow-spread.css b/testsuite/reftests/box-shadow-spread.css
new file mode 100644
index 0000000000..b22bad4ee5
--- /dev/null
+++ b/testsuite/reftests/box-shadow-spread.css
@@ -0,0 +1,9 @@
+@import "reset-to-defaults.css";
+
+.test {
+ box-shadow: 0 0 0 10px red;
+}
+
+.reference {
+ border: solid 10px red;
+}
diff --git a/testsuite/reftests/box-shadow-spread.ref.ui b/testsuite/reftests/box-shadow-spread.ref.ui
new file mode 100644
index 0000000000..f6894c2b34
--- /dev/null
+++ b/testsuite/reftests/box-shadow-spread.ref.ui
@@ -0,0 +1,24 @@
+
+
+
+
+
+
diff --git a/testsuite/reftests/box-shadow-spread.ui b/testsuite/reftests/box-shadow-spread.ui
new file mode 100644
index 0000000000..ef4cdea031
--- /dev/null
+++ b/testsuite/reftests/box-shadow-spread.ui
@@ -0,0 +1,24 @@
+
+
+
+
+
+ 100
+ 100
+ False
+ popup
+
+
+ Hi
+ True
+ False
+ False
+ center
+ center
+
+
+
+
+