Commit 21a71e94 authored by Benjamin Otte's avatar Benjamin Otte

cssimage: Fallback images have no aspect ratio

The aspect ratio for fallback image was incorrectly set to 1.

Reftest is included.
parent 2e7d5c08
......@@ -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]);
}
......
......@@ -209,6 +209,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 \
......
window {
background-color: blue;
background-image: image(red);
background-repeat: no-repeat;
}
#reference {
background: red;
}
<?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>
<?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>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment