forked from AuroraMiddleware/gtk
cssimageradial: Handle "partial" gradients correctly
When the first/last color stop is not at 0%/100%, we need to start the repeating at their offsets and not at 0%/100%. Attached reftest demonstrates the problem.
This commit is contained in:
parent
6c20ddc119
commit
1b553478f6
@ -163,7 +163,7 @@ gtk_css_image_radial_draw (GtkCssImage *image,
|
||||
|
||||
gtk_css_image_radial_get_start_end (radial, radius, &start, &end);
|
||||
|
||||
pattern = cairo_pattern_create_radial (0, 0, 0, 0, 0, radius);
|
||||
pattern = cairo_pattern_create_radial (0, 0, radius * start, 0, 0, radius * end);
|
||||
if (yscale != 1.0)
|
||||
{
|
||||
cairo_matrix_init_scale (&matrix, 1.0, 1.0 / yscale);
|
||||
|
@ -377,6 +377,9 @@ testdata = \
|
||||
quit-mnemonic.css \
|
||||
quit-mnemonic.ref.ui \
|
||||
quit-mnemonic.ui \
|
||||
repeating-radial-gradient-at-beginning.css \
|
||||
repeating-radial-gradient-at-beginning.ref.ui \
|
||||
repeating-radial-gradient-at-beginning.ui \
|
||||
reset-to-defaults.css \
|
||||
revealer-extra-size.ref.ui \
|
||||
revealer-extra-size.ui \
|
||||
|
@ -0,0 +1,11 @@
|
||||
window {
|
||||
background: repeating-radial-gradient(red 50%, blue, red);
|
||||
}
|
||||
|
||||
#reference {
|
||||
background-image: radial-gradient(red, blue, red), repeating-radial-gradient(red 50%, blue, red);
|
||||
background-size: 50% 50%, 100% 100%;
|
||||
background-repeat: no-repeat;
|
||||
background-position: center;
|
||||
}
|
||||
|
@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<!-- interface-requires gtk+ 3.0 -->
|
||||
<object class="GtkWindow" id="window1">
|
||||
<property name="width_request">64</property>
|
||||
<property name="height_request">32</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="type">popup</property>
|
||||
<property name="name">reference</property>
|
||||
</object>
|
||||
</interface>
|
10
testsuite/reftests/repeating-radial-gradient-at-beginning.ui
Normal file
10
testsuite/reftests/repeating-radial-gradient-at-beginning.ui
Normal file
@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<!-- interface-requires gtk+ 3.0 -->
|
||||
<object class="GtkWindow" id="window1">
|
||||
<property name="width_request">64</property>
|
||||
<property name="height_request">32</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="type">popup</property>
|
||||
</object>
|
||||
</interface>
|
Loading…
Reference in New Issue
Block a user