summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Müllner <fmuellner@gnome.org>2013-10-04 21:32:30 +0200
committerFlorian Müllner <fmuellner@gnome.org>2013-10-07 13:22:48 +0200
commit44b1a808c8a74fd3b97367f4819fabcc46a1eb23 (patch)
treebb2e51706f0f0226153014db81262d8602272261
parent067fcc3690b0a354bf0a7b0692aab47fb68a0817 (diff)
downloadclutter-44b1a808c8a74fd3b97367f4819fabcc46a1eb23.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
-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 58274acb7..1cea72187 100644
--- a/clutter/clutter-table-layout.c
+++ b/clutter/clutter-table-layout.c
@@ -1291,7 +1291,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++)
@@ -1331,7 +1331,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++)