[gimp/soc-2010-cage-2] app: define one more standard tool handle size
- From: Michael Muré <mmure src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/soc-2010-cage-2] app: define one more standard tool handle size
- Date: Thu, 30 Dec 2010 18:08:03 +0000 (UTC)
commit 76fc877dea884ed4fe8a66ce586f94fe361b2e9e
Author: Michael Natterer <mitch gimp org>
Date: Mon Nov 8 22:48:50 2010 +0100
app: define one more standard tool handle size
app/tools/gimpaligntool.c | 34 +++++++++++++++++++++++++---------
app/tools/gimpdrawtool.h | 1 +
app/tools/gimpeditselectiontool.c | 5 ++---
app/tools/gimprectangletool.c | 9 +++------
4 files changed, 31 insertions(+), 18 deletions(-)
---
diff --git a/app/tools/gimpaligntool.c b/app/tools/gimpaligntool.c
index fefaef2..0226956 100644
--- a/app/tools/gimpaligntool.c
+++ b/app/tools/gimpaligntool.c
@@ -51,7 +51,7 @@
#include "gimp-intl.h"
#define EPSILON 3 /* move distance after which we do a box-select */
-#define MARKER_WIDTH 5 /* size (in pixels) of the square handles */
+
/* local function prototypes */
@@ -696,16 +696,24 @@ gimp_align_tool_draw (GimpDrawTool *draw_tool)
}
gimp_draw_tool_add_handle (draw_tool, GIMP_HANDLE_FILLED_SQUARE,
- x, y, MARKER_WIDTH, MARKER_WIDTH,
+ x, y,
+ GIMP_TOOL_HANDLE_SIZE_SMALL,
+ GIMP_TOOL_HANDLE_SIZE_SMALL,
GIMP_HANDLE_ANCHOR_NORTH_WEST);
gimp_draw_tool_add_handle (draw_tool, GIMP_HANDLE_FILLED_SQUARE,
- x + w, y, MARKER_WIDTH, MARKER_WIDTH,
+ x + w, y,
+ GIMP_TOOL_HANDLE_SIZE_SMALL,
+ GIMP_TOOL_HANDLE_SIZE_SMALL,
GIMP_HANDLE_ANCHOR_NORTH_EAST);
gimp_draw_tool_add_handle (draw_tool, GIMP_HANDLE_FILLED_SQUARE,
- x, y + h, MARKER_WIDTH, MARKER_WIDTH,
+ x, y + h,
+ GIMP_TOOL_HANDLE_SIZE_SMALL,
+ GIMP_TOOL_HANDLE_SIZE_SMALL,
GIMP_HANDLE_ANCHOR_SOUTH_WEST);
gimp_draw_tool_add_handle (draw_tool, GIMP_HANDLE_FILLED_SQUARE,
- x + w, y + h, MARKER_WIDTH, MARKER_WIDTH,
+ x + w, y + h,
+ GIMP_TOOL_HANDLE_SIZE_SMALL,
+ GIMP_TOOL_HANDLE_SIZE_SMALL,
GIMP_HANDLE_ANCHOR_SOUTH_EAST);
}
else if (GIMP_IS_GUIDE (list->data))
@@ -721,10 +729,14 @@ gimp_align_tool_draw (GimpDrawTool *draw_tool)
x = gimp_guide_get_position (guide);
h = gimp_image_get_height (image);
gimp_draw_tool_add_handle (draw_tool, GIMP_HANDLE_FILLED_SQUARE,
- x, h, MARKER_WIDTH, MARKER_WIDTH,
+ x, h,
+ GIMP_TOOL_HANDLE_SIZE_SMALL,
+ GIMP_TOOL_HANDLE_SIZE_SMALL,
GIMP_HANDLE_ANCHOR_SOUTH);
gimp_draw_tool_add_handle (draw_tool, GIMP_HANDLE_FILLED_SQUARE,
- x, 0, MARKER_WIDTH, MARKER_WIDTH,
+ x, 0,
+ GIMP_TOOL_HANDLE_SIZE_SMALL,
+ GIMP_TOOL_HANDLE_SIZE_SMALL,
GIMP_HANDLE_ANCHOR_NORTH);
break;
@@ -732,10 +744,14 @@ gimp_align_tool_draw (GimpDrawTool *draw_tool)
y = gimp_guide_get_position (guide);
w = gimp_image_get_width (image);
gimp_draw_tool_add_handle (draw_tool, GIMP_HANDLE_FILLED_SQUARE,
- w, y, MARKER_WIDTH, MARKER_WIDTH,
+ w, y,
+ GIMP_TOOL_HANDLE_SIZE_SMALL,
+ GIMP_TOOL_HANDLE_SIZE_SMALL,
GIMP_HANDLE_ANCHOR_EAST);
gimp_draw_tool_add_handle (draw_tool, GIMP_HANDLE_FILLED_SQUARE,
- 0, y, MARKER_WIDTH, MARKER_WIDTH,
+ 0, y,
+ GIMP_TOOL_HANDLE_SIZE_SMALL,
+ GIMP_TOOL_HANDLE_SIZE_SMALL,
GIMP_HANDLE_ANCHOR_WEST);
break;
diff --git a/app/tools/gimpdrawtool.h b/app/tools/gimpdrawtool.h
index a9ff570..f96ae7d 100644
--- a/app/tools/gimpdrawtool.h
+++ b/app/tools/gimpdrawtool.h
@@ -25,6 +25,7 @@
#define GIMP_TOOL_HANDLE_SIZE_CIRCLE 13
#define GIMP_TOOL_HANDLE_SIZE_CROSS 15
#define GIMP_TOOL_HANDLE_SIZE_LARGE 25
+#define GIMP_TOOL_HANDLE_SIZE_SMALL 7
#define GIMP_TYPE_DRAW_TOOL (gimp_draw_tool_get_type ())
diff --git a/app/tools/gimpeditselectiontool.c b/app/tools/gimpeditselectiontool.c
index e09c559..6888215 100644
--- a/app/tools/gimpeditselectiontool.c
+++ b/app/tools/gimpeditselectiontool.c
@@ -62,7 +62,6 @@
#define EDIT_SELECT_SCROLL_LOCK FALSE
#define ARROW_VELOCITY 25
-#define CENTER_CROSS_SIZE 7
typedef struct _GimpEditSelectionTool
@@ -975,8 +974,8 @@ gimp_edit_selection_tool_draw (GimpDrawTool *draw_tool)
GIMP_HANDLE_CROSS,
edit_select->center_x + edit_select->cumlx,
edit_select->center_y + edit_select->cumly,
- CENTER_CROSS_SIZE,
- CENTER_CROSS_SIZE,
+ GIMP_TOOL_HANDLE_SIZE_SMALL,
+ GIMP_TOOL_HANDLE_SIZE_SMALL,
GIMP_HANDLE_ANCHOR_CENTER);
GIMP_DRAW_TOOL_CLASS (parent_class)->draw (draw_tool);
diff --git a/app/tools/gimprectangletool.c b/app/tools/gimprectangletool.c
index 5aebcd1..0a82e5d 100644
--- a/app/tools/gimprectangletool.c
+++ b/app/tools/gimprectangletool.c
@@ -69,10 +69,7 @@ enum
#define MIN_HANDLE_SIZE 15
#define NARROW_MODE_HANDLE_SIZE 15
#define NARROW_MODE_THRESHOLD 45
-#define CENTER_CROSS_SIZE 7
-
-
-#define SQRT5 2.236067977
+#define SQRT5 2.236067977
typedef enum
{
@@ -1778,8 +1775,8 @@ gimp_rectangle_tool_draw (GimpDrawTool *draw_tool,
GIMP_HANDLE_CROSS,
(pub_x1 + pub_x2) / 2.0,
(pub_y1 + pub_y2) / 2.0,
- CENTER_CROSS_SIZE,
- CENTER_CROSS_SIZE,
+ GIMP_TOOL_HANDLE_SIZE_SMALL,
+ GIMP_TOOL_HANDLE_SIZE_SMALL,
GIMP_HANDLE_ANCHOR_CENTER);
break;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]