summaryrefslogtreecommitdiff
path: root/gtk/gtkviewport.c
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2014-05-06 04:00:38 +0200
committerBenjamin Otte <otte@redhat.com>2014-05-06 04:02:40 +0200
commit352e28a1380e5a38ae04de7f7ff30ead8d68666a (patch)
tree7657837592b47c25136f7a124d73014007d7e40a /gtk/gtkviewport.c
parentc39b6be22b5c6a21b5997066e34b0f9d5d92a3ba (diff)
downloadgtk+-352e28a1380e5a38ae04de7f7ff30ead8d68666a.tar.gz
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
Diffstat (limited to 'gtk/gtkviewport.c')
-rw-r--r--gtk/gtkviewport.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/gtk/gtkviewport.c b/gtk/gtkviewport.c
index ec6655fd67..c0bc437c70 100644
--- a/gtk/gtkviewport.c
+++ b/gtk/gtkviewport.c
@@ -1049,24 +1049,28 @@ gtk_viewport_get_preferred_size (GtkWidget *widget,
if (orientation == GTK_ORIENTATION_HORIZONTAL)
{
- for_size -= border.top + border.bottom;
+ if (for_size >= 0)
+ for_size -= border.top + border.bottom;
minimum += border.left + border.right;
}
else
{
- for_size -= border.left + border.right;
+ if (for_size >= 0)
+ for_size -= border.left + border.right;
minimum += border.top + border.bottom;
}
}
if (orientation == GTK_ORIENTATION_HORIZONTAL)
{
- for_size -= padding.top + padding.bottom;
+ if (for_size >= 0)
+ for_size -= padding.top + padding.bottom;
minimum += padding.left + padding.right;
}
else
{
- for_size -= padding.left + padding.right;
+ if (for_size >= 0)
+ for_size -= padding.left + padding.right;
minimum += padding.top + padding.bottom;
}