mirror of https://github.com/GNOME/gimp.git
app/tools: introduce gimp_draw_tool_add_crosshair()
gimp_draw_tool_add_crosshair() is a convenience function that adds two intersecting guide lines in a stroke group.
This commit is contained in:
parent
b74811324a
commit
8587e1e920
|
@ -548,16 +548,9 @@ gimp_color_tool_draw (GimpDrawTool *draw_tool)
|
|||
if (color_tool->sample_point_x != SAMPLE_POINT_POSITION_INVALID &&
|
||||
color_tool->sample_point_y != SAMPLE_POINT_POSITION_INVALID)
|
||||
{
|
||||
gimp_draw_tool_push_group (draw_tool,
|
||||
gimp_draw_tool_add_stroke_group (draw_tool));
|
||||
gimp_draw_tool_add_guide (draw_tool,
|
||||
GIMP_ORIENTATION_VERTICAL,
|
||||
color_tool->sample_point_x, FALSE);
|
||||
gimp_draw_tool_add_guide (draw_tool,
|
||||
GIMP_ORIENTATION_HORIZONTAL,
|
||||
color_tool->sample_point_y, FALSE);
|
||||
|
||||
gimp_draw_tool_pop_group (draw_tool);
|
||||
gimp_draw_tool_add_crosshair (draw_tool,
|
||||
color_tool->sample_point_x,
|
||||
color_tool->sample_point_y);
|
||||
}
|
||||
}
|
||||
else if (color_tool->options->sample_average &&
|
||||
|
|
|
@ -466,7 +466,7 @@ gimp_draw_tool_add_line (GimpDrawTool *draw_tool,
|
|||
}
|
||||
|
||||
/**
|
||||
* gimp_draw_tool_draw_guide:
|
||||
* gimp_draw_tool_add_guide:
|
||||
* @draw_tool: the #GimpDrawTool
|
||||
* @orientation: the orientation of the guide line
|
||||
* @position: the position of the guide line in image coordinates
|
||||
|
@ -493,7 +493,34 @@ gimp_draw_tool_add_guide (GimpDrawTool *draw_tool,
|
|||
}
|
||||
|
||||
/**
|
||||
* gimp_draw_tool_draw_sample_point:
|
||||
* gimp_draw_tool_add_crosshair:
|
||||
* @draw_tool: the #GimpDrawTool
|
||||
* @position_x: the position of the vertical guide line in image coordinates
|
||||
* @position_y: the position of the horizontal guide line in image coordinates
|
||||
*
|
||||
* This function draws two crossing guide lines across the canvas.
|
||||
**/
|
||||
GimpCanvasItem *
|
||||
gimp_draw_tool_add_crosshair (GimpDrawTool *draw_tool,
|
||||
gint position_x,
|
||||
gint position_y)
|
||||
{
|
||||
GimpCanvasGroup *group;
|
||||
|
||||
group = gimp_draw_tool_add_stroke_group (draw_tool);
|
||||
|
||||
gimp_draw_tool_push_group (draw_tool, group);
|
||||
gimp_draw_tool_add_guide (draw_tool,
|
||||
GIMP_ORIENTATION_VERTICAL, position_x, FALSE);
|
||||
gimp_draw_tool_add_guide (draw_tool,
|
||||
GIMP_ORIENTATION_HORIZONTAL, position_y, FALSE);
|
||||
gimp_draw_tool_pop_group (draw_tool);
|
||||
|
||||
return GIMP_CANVAS_ITEM (group);
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_draw_tool_add_sample_point:
|
||||
* @draw_tool: the #GimpDrawTool
|
||||
* @x: X position of the sample point
|
||||
* @y: Y position of the sample point
|
||||
|
|
|
@ -101,6 +101,9 @@ GimpCanvasItem * gimp_draw_tool_add_guide (GimpDrawTool *draw_too
|
|||
GimpOrientationType orientation,
|
||||
gint position,
|
||||
gboolean guide_style);
|
||||
GimpCanvasItem * gimp_draw_tool_add_crosshair (GimpDrawTool *draw_tool,
|
||||
gint position_x,
|
||||
gint position_y);
|
||||
GimpCanvasItem * gimp_draw_tool_add_sample_point (GimpDrawTool *draw_tool,
|
||||
gint x,
|
||||
gint y,
|
||||
|
|
Loading…
Reference in New Issue