[clutter/clutter-1.16] table-layout: Fix size request when there are no visible rows/cols



commit 44b1a808c8a74fd3b97367f4819fabcc46a1eb23
Author: Florian Müllner <fmuellner gnome org>
Date:   Fri Oct 4 21:32:30 2013 +0200

    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

 clutter/clutter-table-layout.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/clutter/clutter-table-layout.c b/clutter/clutter-table-layout.c
index 58274ac..1cea721 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++)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]