mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-10 10:50:10 +00:00
picture: Return natural size 0 for size 0
It was returning the full natural size (same as -1) due to default value handling in the code below. Tests have been updated to match this output.
This commit is contained in:
parent
348e34f221
commit
7ef54e9c53
@ -178,7 +178,8 @@ gtk_picture_measure (GtkWidget *widget,
|
||||
double min_width, min_height, nat_width, nat_height;
|
||||
double default_size;
|
||||
|
||||
if (self->paintable == NULL)
|
||||
/* for_size = 0 below is treated as -1, but we want to return zeros. */
|
||||
if (self->paintable == NULL || for_size == 0)
|
||||
{
|
||||
*minimum = 0;
|
||||
*natural = 0;
|
||||
|
@ -11,5 +11,5 @@ picture {
|
||||
background-image: image(lime);
|
||||
background-repeat: no-repeat;
|
||||
background-position: center;
|
||||
background-size: 150px 150px;
|
||||
background-size: 100px 100px;
|
||||
}
|
||||
|
@ -11,5 +11,5 @@ picture {
|
||||
background-image: image(lime);
|
||||
background-repeat: no-repeat;
|
||||
background-position: center;
|
||||
background-size: 200px 200px;
|
||||
background-size: 100px 100px;
|
||||
}
|
||||
|
@ -11,5 +11,5 @@ picture {
|
||||
background-image: image(lime);
|
||||
background-repeat: no-repeat;
|
||||
background-position: center;
|
||||
background-size: 300px 300px;
|
||||
background-size: 100px 100px;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user