app: don't draw the grid if it covers the image entirely

Regardless of the elaborate discussion in bug #599267, as soon as the
grid starts covering the image completely (when the is no more spacing
between grid lines), it is entirely useless, so skip drawing it.
This commit is contained in:
Michael Natterer 2012-03-04 20:16:14 +01:00
parent 64c996918a
commit 0c236cbc48
1 changed files with 7 additions and 0 deletions

View File

@ -206,6 +206,13 @@ gimp_canvas_grid_draw (GimpCanvasItem *item,
g_return_if_fail (private->grid->xspacing > 0 && private->grid->yspacing > 0);
/* skip grid drawing when the space between grid lines starts
* disappearing, see bug #599267.
*/
if (private->grid->xspacing * shell->scale_x < 2.0 ||
private->grid->yspacing * shell->scale_y < 2.0)
return;
cairo_clip_extents (cr, &dx1, &dy1, &dx2, &dy2);
x1 = floor (dx1);