From 89300c91732edd3c4c3df599fea6de8b4b52320c Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Wed, 24 Sep 2008 12:39:24 +0200 Subject: [PATCH] Fix obvious error in the grid math #8626 --- src/sugar/sugar-grid.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/sugar/sugar-grid.c b/src/sugar/sugar-grid.c index 563d08ac..3fa7de5d 100644 --- a/src/sugar/sugar-grid.c +++ b/src/sugar/sugar-grid.c @@ -55,7 +55,7 @@ sugar_grid_add_weight(SugarGrid *grid, GdkRectangle *rect) for (k = rect->y; k < rect->y + rect->height; k++) { for (i = rect->x; i < rect->x + rect->width; i++) { - grid->weights[i + k * rect->width] += 1; + grid->weights[i + k * grid->width] += 1; } } } @@ -72,7 +72,7 @@ sugar_grid_remove_weight(SugarGrid *grid, GdkRectangle *rect) for (k = rect->y; k < rect->y + rect->height; k++) { for (i = rect->x; i < rect->x + rect->width; i++) { - grid->weights[i + k * rect->width] -= 1; + grid->weights[i + k * grid->width] -= 1; } } } @@ -89,7 +89,7 @@ sugar_grid_compute_weight(SugarGrid *grid, GdkRectangle *rect) for (k = rect->y; k < rect->y + rect->height; k++) { for (i = rect->x; i < rect->x + rect->width; i++) { - sum += grid->weights[i + k * rect->width]; + sum += grid->weights[i + k * grid->width]; } }