summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Müllner <fmuellner@gnome.org>2013-10-04 21:32:30 +0200
committerEmmanuele Bassi <ebassi@gnome.org>2013-11-20 23:13:10 +0000
commit202fc7e528d7e8dca248a603f5593fefb400500d (patch)
treec46daf7966e49e3a12e910780581b7e7e73d96ab
parent2f99c6debe8847f305d52751fd9bb521700cd461 (diff)
downloadclutter-202fc7e528d7e8dca248a603f5593fefb400500d.tar.gz
table-layout: Fix size request when there are no visible rows/cols
The calculation (n - 1) * spacing to compute the total spacing is only correct for n >= 1 - if there are no visible rows/cols, the required spacing is 0 rather than negative. https://bugzilla.gnome.org/show_bug.cgi?id=709434 (cherry picked from commit 44b1a808c8a74fd3b97367f4819fabcc46a1eb23) Signed-off-by: Emmanuele Bassi <ebassi@gnome.org>
-rw-r--r--clutter/clutter-table-layout.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/clutter/clutter-table-layout.c b/clutter/clutter-table-layout.c
index 9927ad59a..0f5b24171 100644
--- a/clutter/clutter-table-layout.c
+++ b/clutter/clutter-table-layout.c
@@ -1297,7 +1297,7 @@ clutter_table_layout_get_preferred_width (ClutterLayoutManager *layout,
calculate_table_dimensions (self, container, -1, for_height);
columns = (DimensionData *) (void *) priv->columns->data;
- total_min_width = (priv->visible_cols - 1) * (float) priv->col_spacing;
+ total_min_width = MAX ((priv->visible_cols - 1) * (float) priv->col_spacing, 0);
total_pref_width = total_min_width;
for (i = 0; i < priv->n_cols; i++)
@@ -1337,7 +1337,7 @@ clutter_table_layout_get_preferred_height (ClutterLayoutManager *layout,
calculate_table_dimensions (self, container, for_width, -1);
rows = (DimensionData *) (void *) priv->rows->data;
- total_min_height = (priv->visible_rows - 1) * (float) priv->row_spacing;
+ total_min_height = MAX ((priv->visible_rows - 1) * (float) priv->row_spacing, 0);
total_pref_height = total_min_height;
for (i = 0; i < self->priv->n_rows; i++)