Always round grid spacings and offsets to integer precision when
using them for snapping and grid drawing. While we might *want* to
have subpixel precision grids, all the UI is pretending it to be
on pixel boundaries. Make that pretense an fact.
and get the shell from gimp_canvas_item_get_shell() if needed. Remove
some cairo_translate() that didn't have any effect and were leftovers
from a very early canvas item code.
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 is a gross hack that typedefs around between GdkRegion and
cairo_region_t and has some evil #ifdefs. This is going to die
immeditately once we can depend on cairo 1.10.
Before, the pattern offset was always relative to the widget, which
completely destroyed the stipples when the got scrolled in. Now we
simply set the shell's scroll offsets as cairo translation and
everything looks perfect.