mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-11 11:20:12 +00:00
viewport: Don't subtract borders and padding from -1
-1 is a special value for "undefined" and needs to stay that way https://bugzilla.gnome.org/show_bug.cgi?id=729607
This commit is contained in:
parent
c39b6be22b
commit
352e28a138
@ -1049,11 +1049,13 @@ gtk_viewport_get_preferred_size (GtkWidget *widget,
|
|||||||
|
|
||||||
if (orientation == GTK_ORIENTATION_HORIZONTAL)
|
if (orientation == GTK_ORIENTATION_HORIZONTAL)
|
||||||
{
|
{
|
||||||
|
if (for_size >= 0)
|
||||||
for_size -= border.top + border.bottom;
|
for_size -= border.top + border.bottom;
|
||||||
minimum += border.left + border.right;
|
minimum += border.left + border.right;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
if (for_size >= 0)
|
||||||
for_size -= border.left + border.right;
|
for_size -= border.left + border.right;
|
||||||
minimum += border.top + border.bottom;
|
minimum += border.top + border.bottom;
|
||||||
}
|
}
|
||||||
@ -1061,11 +1063,13 @@ gtk_viewport_get_preferred_size (GtkWidget *widget,
|
|||||||
|
|
||||||
if (orientation == GTK_ORIENTATION_HORIZONTAL)
|
if (orientation == GTK_ORIENTATION_HORIZONTAL)
|
||||||
{
|
{
|
||||||
|
if (for_size >= 0)
|
||||||
for_size -= padding.top + padding.bottom;
|
for_size -= padding.top + padding.bottom;
|
||||||
minimum += padding.left + padding.right;
|
minimum += padding.left + padding.right;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
if (for_size >= 0)
|
||||||
for_size -= padding.left + padding.right;
|
for_size -= padding.left + padding.right;
|
||||||
minimum += padding.top + padding.bottom;
|
minimum += padding.top + padding.bottom;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user