Commit 3d7716ae authored by Michael Natterer's avatar Michael Natterer 😴

app: use a GimpToolPolygon in GimpFreeSelectTool

parent 2192f520
......@@ -139,7 +139,9 @@ static void gimp_foreground_select_tool_options_notify (GimpTool *tool
static void gimp_foreground_select_tool_draw (GimpDrawTool *draw_tool);
static void gimp_foreground_select_tool_select (GimpFreeSelectTool *free_sel,
GimpDisplay *display);
GimpDisplay *display,
const GimpVector2 *points,
gint n_points);
static void gimp_foreground_select_tool_halt (GimpForegroundSelectTool *fg_select);
static void gimp_foreground_select_tool_commit (GimpForegroundSelectTool *fg_select);
......@@ -889,30 +891,19 @@ gimp_foreground_select_tool_draw (GimpDrawTool *draw_tool)
static void
gimp_foreground_select_tool_select (GimpFreeSelectTool *free_sel,
GimpDisplay *display)
GimpDisplay *display,
const GimpVector2 *points,
gint n_points)
{
GimpForegroundSelectTool *fg_select = GIMP_FOREGROUND_SELECT_TOOL (free_sel);
GimpImage *image = gimp_display_get_image (display);
GimpDrawable *drawable = gimp_image_get_active_drawable (image);
GimpScanConvert *scan_convert;
const GimpVector2 *points;
gint n_points;
if (! drawable)
return;
if (fg_select->state == MATTING_STATE_FREE_SELECT)
if (drawable && fg_select->state == MATTING_STATE_FREE_SELECT)
{
scan_convert = gimp_scan_convert_new ();
gimp_free_select_tool_get_points (free_sel,
&points,
&n_points);
GimpScanConvert *scan_convert = gimp_scan_convert_new ();
gimp_scan_convert_add_polyline (scan_convert,
n_points,
points,
TRUE);
gimp_scan_convert_add_polyline (scan_convert, n_points, points, TRUE);
fg_select->trimap =
gegl_buffer_new (GEGL_RECTANGLE (0, 0,
......
This diff is collapsed.
......@@ -30,12 +30,15 @@
#define GIMP_FREE_SELECT_TOOL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_FREE_SELECT_TOOL, GimpFreeSelectToolClass))
typedef struct _GimpFreeSelectTool GimpFreeSelectTool;
typedef struct _GimpFreeSelectToolClass GimpFreeSelectToolClass;
typedef struct _GimpFreeSelectTool GimpFreeSelectTool;
typedef struct _GimpFreeSelectToolPrivate GimpFreeSelectToolPrivate;
typedef struct _GimpFreeSelectToolClass GimpFreeSelectToolClass;
struct _GimpFreeSelectTool
{
GimpSelectionTool parent_instance;
GimpSelectionTool parent_instance;
GimpFreeSelectToolPrivate *private;
};
struct _GimpFreeSelectToolClass
......@@ -45,18 +48,16 @@ struct _GimpFreeSelectToolClass
/* virtual function */
void (* select) (GimpFreeSelectTool *free_select_tool,
GimpDisplay *display);
GimpDisplay *display,
const GimpVector2 *points,
gint n_points);
};
void gimp_free_select_tool_register (GimpToolRegisterCallback callback,
gpointer data);
GType gimp_free_select_tool_get_type (void) G_GNUC_CONST;
void gimp_free_select_tool_register (GimpToolRegisterCallback callback,
gpointer data);
void gimp_free_select_tool_get_points (GimpFreeSelectTool *free_sel,
const GimpVector2 **points,
gint *n_points);
GType gimp_free_select_tool_get_type (void) G_GNUC_CONST;
#endif /* __GIMP_FREE_SELECT_TOOL_H__ */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment