forked from AuroraMiddleware/gtk
cssimage: Fallback images have no aspect ratio
The aspect ratio for fallback image was incorrectly set to 1. Reftest is included.
This commit is contained in:
parent
a06b1ea1ba
commit
e5e5beafa5
@ -56,7 +56,7 @@ gtk_css_image_fallback_get_aspect_ratio (GtkCssImage *image)
|
||||
GtkCssImageFallback *fallback = GTK_CSS_IMAGE_FALLBACK (image);
|
||||
|
||||
if (fallback->used < 0)
|
||||
return 1;
|
||||
return 0;
|
||||
|
||||
return _gtk_css_image_get_aspect_ratio (fallback->images[fallback->used]);
|
||||
}
|
||||
|
@ -201,6 +201,9 @@ testdata = \
|
||||
css-image-aspect-ratio.css \
|
||||
css-image-aspect-ratio.ui \
|
||||
css-image-aspect-ratio.ref.ui \
|
||||
css-image-color-aspect-ratio.css \
|
||||
css-image-color-aspect-ratio.ui \
|
||||
css-image-color-aspect-ratio.ref.ui \
|
||||
css-match-class.css \
|
||||
css-match-class.ref.ui \
|
||||
css-match-class.ui \
|
||||
|
9
testsuite/reftests/css-image-color-aspect-ratio.css
Normal file
9
testsuite/reftests/css-image-color-aspect-ratio.css
Normal file
@ -0,0 +1,9 @@
|
||||
window {
|
||||
background-color: blue;
|
||||
background-image: image(red);
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
#reference {
|
||||
background: red;
|
||||
}
|
11
testsuite/reftests/css-image-color-aspect-ratio.ref.ui
Normal file
11
testsuite/reftests/css-image-color-aspect-ratio.ref.ui
Normal file
@ -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">20</property>
|
||||
<property name="height_request">10</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="type">popup</property>
|
||||
<property name="name">reference</property>
|
||||
</object>
|
||||
</interface>
|
10
testsuite/reftests/css-image-color-aspect-ratio.ui
Normal file
10
testsuite/reftests/css-image-color-aspect-ratio.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">20</property>
|
||||
<property name="height_request">10</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="type">popup</property>
|
||||
</object>
|
||||
</interface>
|
Loading…
Reference in New Issue
Block a user