172 |
|
|
173 |
// Compute width and height of each cell in the grid. |
// Compute width and height of each cell in the grid. |
174 |
int tw = d.width - ins.left - ins.right; |
int tw = d.width - ins.left - ins.right; |
175 |
tw = (tw - (real_rows - 1) * hgap) / real_rows; |
tw = (tw - (real_cols - 1) * hgap) / real_cols; |
176 |
int th = d.height - ins.top - ins.bottom; |
int th = d.height - ins.top - ins.bottom; |
177 |
th = (th - (real_cols - 1) * vgap) / real_cols; |
th = (th - (real_rows - 1) * vgap) / real_rows; |
178 |
|
|
179 |
// If the cells are too small, still try to do something. |
// If the cells are too small, still try to do something. |
180 |
if (tw < 0) |
if (tw < 0) |