[clutter/clutter-1.14] table-layout: Fix size request when there are no visible rows/cols
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [clutter/clutter-1.14] table-layout: Fix size request when there are no visible rows/cols
- Date: Thu, 21 Nov 2013 00:09:47 +0000 (UTC)
commit 202fc7e528d7e8dca248a603f5593fefb400500d
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
(cherry picked from commit 44b1a808c8a74fd3b97367f4819fabcc46a1eb23)
Signed-off-by: Emmanuele Bassi <ebassi gnome org>
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 9927ad5..0f5b241 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++)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]