[gimp] app: make blend's and straight line's start-line-end drawing look nicer
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] app: make blend's and straight line's start-line-end drawing look nicer
- Date: Sat, 12 Apr 2014 20:13:39 +0000 (UTC)
commit 2a9b6bf5696cb7d573c8768a517be8785254e84e
Author: Michael Natterer <mitch gimp org>
Date: Sat Apr 12 22:10:26 2014 +0200
app: make blend's and straight line's start-line-end drawing look nicer
Use circle handles instead of crosses, and put the items into a stroke
group so they don't look ugly when drawing over each other.
app/tools/gimpblendtool.c | 23 +++++++++++++----------
app/tools/gimppainttool.c | 28 ++++++++++++++++------------
2 files changed, 29 insertions(+), 22 deletions(-)
---
diff --git a/app/tools/gimpblendtool.c b/app/tools/gimpblendtool.c
index 0232147..b4ccbef 100644
--- a/app/tools/gimpblendtool.c
+++ b/app/tools/gimpblendtool.c
@@ -384,19 +384,21 @@ gimp_blend_tool_cursor_update (GimpTool *tool,
static void
gimp_blend_tool_draw (GimpDrawTool *draw_tool)
{
- GimpBlendTool *blend_tool = GIMP_BLEND_TOOL (draw_tool);
+ GimpBlendTool *blend_tool = GIMP_BLEND_TOOL (draw_tool);
+ GimpCanvasGroup *group;
+
+ group = gimp_draw_tool_add_stroke_group (draw_tool);
+ gimp_draw_tool_push_group (draw_tool, group);
- /* Draw start target */
blend_tool->start_handle =
gimp_draw_tool_add_handle (draw_tool,
- GIMP_HANDLE_CROSS,
+ GIMP_HANDLE_CIRCLE,
blend_tool->start_x,
blend_tool->start_y,
- GIMP_TOOL_HANDLE_SIZE_CROSS,
- GIMP_TOOL_HANDLE_SIZE_CROSS,
+ GIMP_TOOL_HANDLE_SIZE_CIRCLE,
+ GIMP_TOOL_HANDLE_SIZE_CIRCLE,
GIMP_HANDLE_ANCHOR_CENTER);
- /* Draw the line between the start and end coords */
blend_tool->line =
gimp_draw_tool_add_line (draw_tool,
blend_tool->start_x,
@@ -404,15 +406,16 @@ gimp_blend_tool_draw (GimpDrawTool *draw_tool)
blend_tool->end_x,
blend_tool->end_y);
- /* Draw end target */
blend_tool->end_handle =
gimp_draw_tool_add_handle (draw_tool,
- GIMP_HANDLE_CROSS,
+ GIMP_HANDLE_CIRCLE,
blend_tool->end_x,
blend_tool->end_y,
- GIMP_TOOL_HANDLE_SIZE_CROSS,
- GIMP_TOOL_HANDLE_SIZE_CROSS,
+ GIMP_TOOL_HANDLE_SIZE_CIRCLE,
+ GIMP_TOOL_HANDLE_SIZE_CIRCLE,
GIMP_HANDLE_ANCHOR_CENTER);
+
+ gimp_draw_tool_pop_group (draw_tool);
}
static void
diff --git a/app/tools/gimppainttool.c b/app/tools/gimppainttool.c
index 312aa41..9a24910 100644
--- a/app/tools/gimppainttool.c
+++ b/app/tools/gimppainttool.c
@@ -753,27 +753,31 @@ gimp_paint_tool_draw (GimpDrawTool *draw_tool)
if (paint_tool->draw_line &&
! gimp_tool_control_is_active (GIMP_TOOL (draw_tool)->control))
{
- /* Draw the line between the start and end coords */
- gimp_draw_tool_add_line (draw_tool,
- last_x, last_y,
- cur_x, cur_y);
+ GimpCanvasGroup *group;
+
+ group = gimp_draw_tool_add_stroke_group (draw_tool);
+ gimp_draw_tool_push_group (draw_tool, group);
- /* Draw start target */
gimp_draw_tool_add_handle (draw_tool,
- GIMP_HANDLE_CROSS,
+ GIMP_HANDLE_CIRCLE,
last_x, last_y,
- GIMP_TOOL_HANDLE_SIZE_CROSS,
- GIMP_TOOL_HANDLE_SIZE_CROSS,
+ GIMP_TOOL_HANDLE_SIZE_CIRCLE,
+ GIMP_TOOL_HANDLE_SIZE_CIRCLE,
GIMP_HANDLE_ANCHOR_CENTER);
- /* Draw end target */
+ gimp_draw_tool_add_line (draw_tool,
+ last_x, last_y,
+ cur_x, cur_y);
+
gimp_draw_tool_add_handle (draw_tool,
- GIMP_HANDLE_CROSS,
+ GIMP_HANDLE_CIRCLE,
cur_x, cur_y,
- GIMP_TOOL_HANDLE_SIZE_CROSS,
- GIMP_TOOL_HANDLE_SIZE_CROSS,
+ GIMP_TOOL_HANDLE_SIZE_CIRCLE,
+ GIMP_TOOL_HANDLE_SIZE_CIRCLE,
GIMP_HANDLE_ANCHOR_CENTER);
+ gimp_draw_tool_pop_group (draw_tool);
+
line_drawn = TRUE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]