GNOME Bugzilla – Bug 679990
clutter_table_layout_pack increments column/row count by two
Last modified: 2012-08-27 15:48:05 UTC
clutter_table_layout_pack increments the column/row count by two, when called in "append" mode with a negative column/row parameter. It further results in layout errors when using column/row spacing, because the calculated amount of required spacing is twice as high as it should be. Attached is a script to reproduce the wrong incrementation of column/row counts.
Created attachment 218890 [details] [review] Proposed bug fix; this time with commit message using git format-patch.
Created attachment 218891 [details] script to reproduce wrong column count
Review of attachment 218890 [details] [review]: thanks for the patch! looks generally okay; can I ask you to attach a patch with a commit message - preferably one generated using git format-patch or git bz? thanks!
Comment on attachment 218890 [details] [review] Proposed bug fix; this time with commit message using git format-patch. From a43eb83467fc19614ea56775e4589997ceb79e94 Mon Sep 17 00:00:00 2001 From: Andre Kuehne <andre.kuehne.77@gmail.com> Date: Wed, 18 Jul 2012 20:57:00 +0200 Subject: [PATCH] Fix clutter_table_layout_pack row/column count incrementation. When appending (with a negative row/column parameter), the row/column count should be incremented by 1, not 2. This also fixes layout errors when using column/row spacing: The amount of extra space required was calculated incorrectly due to the wrong column count. --- clutter/clutter-table-layout.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/clutter/clutter-table-layout.c b/clutter/clutter-table-layout.c index 4472902..9927ad5 100644 --- a/clutter/clutter-table-layout.c +++ b/clutter/clutter-table-layout.c @@ -1905,10 +1905,10 @@ clutter_table_layout_pack (ClutterTableLayout *layout, g_assert (CLUTTER_IS_TABLE_CHILD (meta)); if (row < 0) - row = priv->n_rows + 1; + row = priv->n_rows; if (column < 0) - column = priv->n_cols + 1; + column = priv->n_cols; table_child_set_position (CLUTTER_TABLE_CHILD (meta), column, row); } -- 1.7.10.4
Created attachment 219152 [details] [review] Proposed bug fix; this time with commit message using git format-patch. I guess Edit Attachment As Comment was not what I wanted after all.
Review of attachment 219152 [details] [review]: looks great, thanks!
Attachment 219152 [details] pushed to master, thanks!