mirror of https://github.com/GNOME/gimp.git
gimptoolpath: use drop shaped handle to indicate the start of a stroke.
This commit is contained in:
parent
44352cb769
commit
000bc5fff4
|
@ -28,6 +28,7 @@
|
||||||
#include <gdk/gdkkeysyms.h>
|
#include <gdk/gdkkeysyms.h>
|
||||||
|
|
||||||
#include "libgimpbase/gimpbase.h"
|
#include "libgimpbase/gimpbase.h"
|
||||||
|
#include "libgimpmath/gimpmath.h"
|
||||||
|
|
||||||
#include "display-types.h"
|
#include "display-types.h"
|
||||||
|
|
||||||
|
@ -401,6 +402,7 @@ gimp_tool_path_changed (GimpToolWidget *widget)
|
||||||
GArray *coords;
|
GArray *coords;
|
||||||
GList *draw_anchors;
|
GList *draw_anchors;
|
||||||
GList *list;
|
GList *list;
|
||||||
|
gboolean first = TRUE;
|
||||||
|
|
||||||
/* anchor handles */
|
/* anchor handles */
|
||||||
draw_anchors = gimp_stroke_get_draw_anchors (cur_stroke);
|
draw_anchors = gimp_stroke_get_draw_anchors (cur_stroke);
|
||||||
|
@ -422,7 +424,39 @@ gimp_tool_path_changed (GimpToolWidget *widget)
|
||||||
GIMP_CANVAS_HANDLE_SIZE_CIRCLE,
|
GIMP_CANVAS_HANDLE_SIZE_CIRCLE,
|
||||||
GIMP_HANDLE_ANCHOR_CENTER);
|
GIMP_HANDLE_ANCHOR_CENTER);
|
||||||
|
|
||||||
|
if (first)
|
||||||
|
{
|
||||||
|
gdouble angle = 0.0;
|
||||||
|
GimpAnchor *next;
|
||||||
|
|
||||||
|
for (next = gimp_stroke_anchor_get_next (cur_stroke,
|
||||||
|
cur_anchor);
|
||||||
|
next;
|
||||||
|
next = gimp_stroke_anchor_get_next (cur_stroke, next))
|
||||||
|
{
|
||||||
|
if (((next->position.x - cur_anchor->position.x) *
|
||||||
|
(next->position.x - cur_anchor->position.x) +
|
||||||
|
(next->position.y - cur_anchor->position.y) *
|
||||||
|
(next->position.y - cur_anchor->position.y)) >= 0.1)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (next)
|
||||||
|
{
|
||||||
|
angle = atan2 (next->position.y - cur_anchor->position.y,
|
||||||
|
next->position.x - cur_anchor->position.x);
|
||||||
|
g_object_set (item,
|
||||||
|
"type", (cur_anchor->selected ?
|
||||||
|
GIMP_HANDLE_DROP :
|
||||||
|
GIMP_HANDLE_FILLED_DROP),
|
||||||
|
"start-angle", angle,
|
||||||
|
NULL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private->items = g_list_prepend (private->items, item);
|
private->items = g_list_prepend (private->items, item);
|
||||||
|
|
||||||
|
first = FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue