#define the constant crosshair size for the INTERSECTION grid style

2004-09-07  Michael Natterer  <mitch@gimp.org>

	* app/display/gimpdisplayshell-draw.c
	(gimp_display_shell_draw_grid): #define the constant crosshair
	size for the INTERSECTION grid style instead of using an eeky
	"const gint".
This commit is contained in:
Michael Natterer 2004-09-07 19:08:55 +00:00 committed by Michael Natterer
parent 19d523f6c7
commit 567385a150
2 changed files with 19 additions and 7 deletions

View File

@ -1,3 +1,10 @@
2004-09-07 Michael Natterer <mitch@gimp.org>
* app/display/gimpdisplayshell-draw.c
(gimp_display_shell_draw_grid): #define the constant crosshair
size for the INTERSECTION grid style instead of using an eeky
"const gint".
2004-09-07 Michael Natterer <mitch@gimp.org>
* app/gui/dialogs.c (toplevel_entries): added a foreign entry

View File

@ -140,7 +140,8 @@ gimp_display_shell_draw_grid (GimpDisplayShell *shell,
gint x_real, y_real;
gint x_offset, y_offset;
gint width, height;
const gint length = 2;
#define CROSSHAIR 2
grid = GIMP_GRID (shell->gdisp->gimage->grid);
if (! grid)
@ -211,7 +212,7 @@ gimp_display_shell_draw_grid (GimpDisplayShell *shell,
x, 0, &x_real, &y_real,
FALSE);
if (x_real + length < x1 || x_real - length >= x2)
if (x_real + CROSSHAIR < x1 || x_real - CROSSHAIR >= x2)
continue;
for (y = y_offset; y <= height; y += grid->yspacing)
@ -223,20 +224,24 @@ gimp_display_shell_draw_grid (GimpDisplayShell *shell,
x, y, &x_real, &y_real,
FALSE);
if (y_real + length < y1 || y_real - length >= y2)
if (y_real + CROSSHAIR < y1 || y_real - CROSSHAIR >= y2)
continue;
if (x_real >= x1 && x_real < x2)
gimp_canvas_draw_line (canvas, GIMP_CANVAS_STYLE_CUSTOM,
x_real,
CLAMP (y_real - length, y1, y2 - 1),
CLAMP (y_real - CROSSHAIR,
y1, y2 - 1),
x_real,
CLAMP (y_real + length, y1, y2 - 1));
CLAMP (y_real + CROSSHAIR,
y1, y2 - 1));
if (y_real >= y1 && y_real < y2)
gimp_canvas_draw_line (canvas, GIMP_CANVAS_STYLE_CUSTOM,
CLAMP (x_real - length, x1, x2 - 1),
CLAMP (x_real - CROSSHAIR,
x1, x2 - 1),
y_real,
CLAMP (x_real + length, x1, x2 - 1),
CLAMP (x_real + CROSSHAIR,
x1, x2 - 1),
y_real);
}
}