roundedbox: Only grow border-radius if there is one
This is relevant for shadow spread and goes in line with the web. Testcase included.
This commit is contained in:
@ -149,8 +149,10 @@ gtk_css_border_radius_grow (GtkRoundedBoxCorner *corner,
|
|||||||
double horizontal,
|
double horizontal,
|
||||||
double vertical)
|
double vertical)
|
||||||
{
|
{
|
||||||
corner->horizontal += horizontal;
|
if (corner->horizontal)
|
||||||
corner->vertical += vertical;
|
corner->horizontal += horizontal;
|
||||||
|
if (corner->vertical)
|
||||||
|
corner->vertical += vertical;
|
||||||
|
|
||||||
if (corner->horizontal <= 0 || corner->vertical <= 0)
|
if (corner->horizontal <= 0 || corner->vertical <= 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -143,6 +143,9 @@ testdata = \
|
|||||||
box-shadow-spec-inset.css \
|
box-shadow-spec-inset.css \
|
||||||
box-shadow-spec-inset.ref.ui \
|
box-shadow-spec-inset.ref.ui \
|
||||||
box-shadow-spec-inset.ui \
|
box-shadow-spec-inset.ui \
|
||||||
|
box-shadow-spread.css \
|
||||||
|
box-shadow-spread.ref.ui \
|
||||||
|
box-shadow-spread.ui \
|
||||||
button-wrapping.ui \
|
button-wrapping.ui \
|
||||||
button-wrapping.ref.ui \
|
button-wrapping.ref.ui \
|
||||||
cellrenderer-pixbuf-stock-rtl.css \
|
cellrenderer-pixbuf-stock-rtl.css \
|
||||||
|
|||||||
9
testsuite/reftests/box-shadow-spread.css
Normal file
9
testsuite/reftests/box-shadow-spread.css
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
@import "reset-to-defaults.css";
|
||||||
|
|
||||||
|
.test {
|
||||||
|
box-shadow: 0 0 0 10px red;
|
||||||
|
}
|
||||||
|
|
||||||
|
.reference {
|
||||||
|
border: solid 10px red;
|
||||||
|
}
|
||||||
24
testsuite/reftests/box-shadow-spread.ref.ui
Normal file
24
testsuite/reftests/box-shadow-spread.ref.ui
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!-- Generated with glade 3.18.1 -->
|
||||||
|
<interface>
|
||||||
|
<requires lib="gtk+" version="3.12"/>
|
||||||
|
<object class="GtkWindow" id="window1">
|
||||||
|
<property name="width_request">100</property>
|
||||||
|
<property name="height_request">100</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<property name="type">popup</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkButton" id="button1">
|
||||||
|
<property name="label" translatable="yes">Hi</property>
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<property name="receives_default">False</property>
|
||||||
|
<property name="halign">center</property>
|
||||||
|
<property name="valign">center</property>
|
||||||
|
<style>
|
||||||
|
<class name="reference"/>
|
||||||
|
</style>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</interface>
|
||||||
24
testsuite/reftests/box-shadow-spread.ui
Normal file
24
testsuite/reftests/box-shadow-spread.ui
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!-- Generated with glade 3.18.1 -->
|
||||||
|
<interface>
|
||||||
|
<requires lib="gtk+" version="3.12"/>
|
||||||
|
<object class="GtkWindow" id="window1">
|
||||||
|
<property name="width_request">100</property>
|
||||||
|
<property name="height_request">100</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<property name="type">popup</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkButton" id="button1">
|
||||||
|
<property name="label" translatable="yes">Hi</property>
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<property name="receives_default">False</property>
|
||||||
|
<property name="halign">center</property>
|
||||||
|
<property name="valign">center</property>
|
||||||
|
<style>
|
||||||
|
<class name="test"/>
|
||||||
|
</style>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</interface>
|
||||||
Reference in New Issue
Block a user