Ticket #8626: grid.patch

File grid.patch, 1.1 KB (added by marco, 6 years ago)
  • src/sugar/sugar-grid.c

    diff --git a/src/sugar/sugar-grid.c b/src/sugar/sugar-grid.c
    index 563d08a..3fa7de5 100644
    a b sugar_grid_add_weight(SugarGrid *grid, GdkRectangle *rect) 
    5555 
    5656    for (k = rect->y; k < rect->y + rect->height; k++) { 
    5757        for (i = rect->x; i < rect->x + rect->width; i++) { 
    58             grid->weights[i + k * rect->width] += 1; 
     58            grid->weights[i + k * grid->width] += 1; 
    5959        } 
    6060    } 
    6161} 
    sugar_grid_remove_weight(SugarGrid *grid, GdkRectangle *rect) 
    7272 
    7373    for (k = rect->y; k < rect->y + rect->height; k++) { 
    7474        for (i = rect->x; i < rect->x + rect->width; i++) { 
    75             grid->weights[i + k * rect->width] -= 1; 
     75            grid->weights[i + k * grid->width] -= 1; 
    7676        } 
    7777    } 
    7878} 
    sugar_grid_compute_weight(SugarGrid *grid, GdkRectangle *rect) 
    8989 
    9090    for (k = rect->y; k < rect->y + rect->height; k++) { 
    9191        for (i = rect->x; i < rect->x + rect->width; i++) { 
    92             sum += grid->weights[i + k * rect->width]; 
     92            sum += grid->weights[i + k * grid->width]; 
    9393        } 
    9494    } 
    9595