[gimp] app: move the GIMP_CURSOR_SIZE define to a single place in the right header
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] app: move the GIMP_CURSOR_SIZE define to a single place in the right header
- Date: Thu, 26 Aug 2010 17:14:28 +0000 (UTC)
commit d745ab387168dc583a87ea49822d4a64f140feac
Author: Michael Natterer <mitch gimp org>
Date: Thu Aug 26 19:13:49 2010 +0200
app: move the GIMP_CURSOR_SIZE define to a single place in the right header
app/display/gimpdisplayshell-cursor.c | 18 ++++++++----------
app/display/gimpdisplayshell-cursor.h | 3 +++
app/display/gimpdisplayshell-draw.c | 27 +++++++++++++--------------
3 files changed, 24 insertions(+), 24 deletions(-)
---
diff --git a/app/display/gimpdisplayshell-cursor.c b/app/display/gimpdisplayshell-cursor.c
index 6acc305..e2edb75 100644
--- a/app/display/gimpdisplayshell-cursor.c
+++ b/app/display/gimpdisplayshell-cursor.c
@@ -141,17 +141,15 @@ gimp_display_shell_update_cursor (GimpDisplayShell *shell,
/* Erase old cursor, if necessary */
-#define CURSOR_SIZE 14
-
if (shell->have_cursor && (! new_cursor ||
display_x != shell->cursor_x ||
display_y != shell->cursor_y))
{
gimp_display_shell_expose_area (shell,
- shell->cursor_x - CURSOR_SIZE,
- shell->cursor_y - CURSOR_SIZE,
- 2 * CURSOR_SIZE + 1,
- 2 * CURSOR_SIZE + 1);
+ shell->cursor_x - GIMP_CURSOR_SIZE,
+ shell->cursor_y - GIMP_CURSOR_SIZE,
+ 2 * GIMP_CURSOR_SIZE + 1,
+ 2 * GIMP_CURSOR_SIZE + 1);
}
shell->have_cursor = new_cursor;
@@ -161,10 +159,10 @@ gimp_display_shell_update_cursor (GimpDisplayShell *shell,
if (shell->have_cursor)
{
gimp_display_shell_expose_area (shell,
- shell->cursor_x - CURSOR_SIZE,
- shell->cursor_y - CURSOR_SIZE,
- 2 * CURSOR_SIZE + 1,
- 2 * CURSOR_SIZE + 1);
+ shell->cursor_x - GIMP_CURSOR_SIZE,
+ shell->cursor_y - GIMP_CURSOR_SIZE,
+ 2 * GIMP_CURSOR_SIZE + 1,
+ 2 * GIMP_CURSOR_SIZE + 1);
}
/* use the passed image_coords for the statusbar because they are
diff --git a/app/display/gimpdisplayshell-cursor.h b/app/display/gimpdisplayshell-cursor.h
index 18bf871..eeef566 100644
--- a/app/display/gimpdisplayshell-cursor.h
+++ b/app/display/gimpdisplayshell-cursor.h
@@ -19,6 +19,9 @@
#define __GIMP_DISPLAY_SHELL_CURSOR_H__
+#define GIMP_CURSOR_SIZE 7
+
+
void gimp_display_shell_set_cursor (GimpDisplayShell *shell,
GimpCursorType cursor_type,
GimpToolCursorType tool_cursor,
diff --git a/app/display/gimpdisplayshell-draw.c b/app/display/gimpdisplayshell-draw.c
index df3d99c..5a08c2a 100644
--- a/app/display/gimpdisplayshell-draw.c
+++ b/app/display/gimpdisplayshell-draw.c
@@ -49,6 +49,7 @@
#include "gimpdisplay.h"
#include "gimpdisplayshell.h"
#include "gimpdisplayshell-appearance.h"
+#include "gimpdisplayshell-cursor.h"
#include "gimpdisplayshell-draw.h"
#include "gimpdisplayshell-render.h"
#include "gimpdisplayshell-scale.h"
@@ -707,31 +708,29 @@ gimp_display_shell_draw_cursor (GimpDisplayShell *shell,
gimp_display_shell_set_cursor_style (shell, cr);
cairo_translate (cr, 0.5, 0.5);
-#define CURSOR_SIZE 14
-
cairo_set_source_rgb (cr, 1.0, 1.0, 1.0);
- cairo_move_to (cr, shell->cursor_x - CURSOR_SIZE, shell->cursor_y - 1);
- cairo_line_to (cr, shell->cursor_x + CURSOR_SIZE, shell->cursor_y - 1);
+ cairo_move_to (cr, shell->cursor_x - GIMP_CURSOR_SIZE, shell->cursor_y - 1);
+ cairo_line_to (cr, shell->cursor_x + GIMP_CURSOR_SIZE, shell->cursor_y - 1);
- cairo_move_to (cr, shell->cursor_x - CURSOR_SIZE, shell->cursor_y + 1);
- cairo_line_to (cr, shell->cursor_x + CURSOR_SIZE, shell->cursor_y + 1);
+ cairo_move_to (cr, shell->cursor_x - GIMP_CURSOR_SIZE, shell->cursor_y + 1);
+ cairo_line_to (cr, shell->cursor_x + GIMP_CURSOR_SIZE, shell->cursor_y + 1);
- cairo_move_to (cr, shell->cursor_x - 1, shell->cursor_y - CURSOR_SIZE);
- cairo_line_to (cr, shell->cursor_x - 1, shell->cursor_y + CURSOR_SIZE);
+ cairo_move_to (cr, shell->cursor_x - 1, shell->cursor_y - GIMP_CURSOR_SIZE);
+ cairo_line_to (cr, shell->cursor_x - 1, shell->cursor_y + GIMP_CURSOR_SIZE);
- cairo_move_to (cr, shell->cursor_x + 1, shell->cursor_y - CURSOR_SIZE);
- cairo_line_to (cr, shell->cursor_x + 1, shell->cursor_y + CURSOR_SIZE);
+ cairo_move_to (cr, shell->cursor_x + 1, shell->cursor_y - GIMP_CURSOR_SIZE);
+ cairo_line_to (cr, shell->cursor_x + 1, shell->cursor_y + GIMP_CURSOR_SIZE);
cairo_stroke (cr);
cairo_set_source_rgb (cr, 0.0, 0.0, 0.0);
- cairo_move_to (cr, shell->cursor_x - CURSOR_SIZE, shell->cursor_y);
- cairo_line_to (cr, shell->cursor_x + CURSOR_SIZE, shell->cursor_y);
+ cairo_move_to (cr, shell->cursor_x - GIMP_CURSOR_SIZE, shell->cursor_y);
+ cairo_line_to (cr, shell->cursor_x + GIMP_CURSOR_SIZE, shell->cursor_y);
- cairo_move_to (cr, shell->cursor_x, shell->cursor_y - CURSOR_SIZE);
- cairo_line_to (cr, shell->cursor_x, shell->cursor_y + CURSOR_SIZE);
+ cairo_move_to (cr, shell->cursor_x, shell->cursor_y - GIMP_CURSOR_SIZE);
+ cairo_line_to (cr, shell->cursor_x, shell->cursor_y + GIMP_CURSOR_SIZE);
cairo_stroke (cr);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]