After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 679990 - clutter_table_layout_pack increments column/row count by two
clutter_table_layout_pack increments column/row count by two
Status: RESOLVED FIXED
Product: clutter
Classification: Platform
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: clutter-maint
clutter-maint
Depends on:
Blocks:
 
 
Reported: 2012-07-16 08:21 UTC by Andre Kuehne
Modified: 2012-08-27 15:48 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Proposed bug fix; this time with commit message using git format-patch. (535 bytes, patch)
2012-07-16 08:22 UTC, Andre Kuehne
reviewed Details | Review
script to reproduce wrong column count (434 bytes, text/plain)
2012-07-16 08:25 UTC, Andre Kuehne
  Details
Proposed bug fix; this time with commit message using git format-patch. (1.12 KB, patch)
2012-07-18 19:12 UTC, Andre Kuehne
committed Details | Review

Description Andre Kuehne 2012-07-16 08:21:04 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.
Comment 1 Andre Kuehne 2012-07-16 08:22:49 UTC
Created attachment 218890 [details] [review]
Proposed bug fix; this time with commit message using git format-patch.
Comment 2 Andre Kuehne 2012-07-16 08:25:32 UTC
Created attachment 218891 [details]
script to reproduce wrong column count
Comment 3 Emmanuele Bassi (:ebassi) 2012-07-17 20:12:56 UTC
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 4 Andre Kuehne 2012-07-18 19:04:33 UTC
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
Comment 5 Andre Kuehne 2012-07-18 19:12:47 UTC
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.
Comment 6 Emmanuele Bassi (:ebassi) 2012-08-27 15:21:08 UTC
Review of attachment 219152 [details] [review]:

looks great, thanks!
Comment 7 Emmanuele Bassi (:ebassi) 2012-08-27 15:47:58 UTC
Attachment 219152 [details] pushed to master, thanks!