app: add gimp_grid_get_spacing() and gimp_grid_get_offset()

and do the rounding to integer there instead of in several places.
This commit is contained in:
Michael Natterer
2014-05-21 21:25:41 +02:00
parent 08c6aefa23
commit 5e2ded5020
4 changed files with 42 additions and 42 deletions

View File

@ -200,18 +200,8 @@ gimp_canvas_grid_draw (GimpCanvasItem *item,
#define CROSSHAIR 2
g_object_get (private->grid,
"xspacing", &xspacing,
"yspacing", &yspacing,
"xoffset", &xoffset,
"yoffset", &yoffset,
NULL);
/* FIXME subpixel grid */
xspacing = RINT (xspacing);
yspacing = RINT (yspacing);
xoffset = RINT (xoffset);
yoffset = RINT (yoffset);
gimp_grid_get_spacing (private->grid, &xspacing, &yspacing);
gimp_grid_get_offset (private->grid, &xoffset, &yoffset);
g_return_if_fail (xspacing > 0.0 &&
yspacing > 0.0);