Merge branch 'master-subtract-base-size' into 'master'

gdk: Subtract base size when checking aspect ratio

See merge request GNOME/gtk!1331
This commit is contained in:
Matthias Clasen 2020-02-14 13:19:42 +00:00
commit b6cb1a6eb3

View File

@ -1726,6 +1726,16 @@ gdk_surface_constrain_size (GdkGeometry *geometry,
{
gint delta;
if (flags & GDK_HINT_BASE_SIZE)
{
width -= base_width;
height -= base_height;
min_width -= base_width;
min_height -= base_height;
max_width -= base_width;
max_height -= base_height;
}
if (geometry->min_aspect * height > width)
{
delta = FLOOR (height - width / geometry->min_aspect, yinc);
@ -1751,6 +1761,12 @@ gdk_surface_constrain_size (GdkGeometry *geometry,
height += delta;
}
}
if (flags & GDK_HINT_BASE_SIZE)
{
width += base_width;
height += base_height;
}
}
#undef FLOOR