Example #1
0
/**
 * 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);
}
static void
gimp_move_tool_draw (GimpDrawTool *draw_tool)
{
  GimpMoveTool *move = GIMP_MOVE_TOOL (draw_tool);

  if (move->guide)
    {
      GimpCanvasItem *item;

      item = gimp_draw_tool_add_guide (draw_tool,
                                       gimp_guide_get_orientation (move->guide),
                                       gimp_guide_get_position (move->guide),
                                       TRUE);
      gimp_canvas_item_set_highlight (item, TRUE);
    }

  if (move->moving_guide && move->guide_position != GUIDE_POSITION_INVALID)
    {
      gimp_draw_tool_add_guide (draw_tool,
                                move->guide_orientation,
                                move->guide_position,
                                FALSE);
    }
}
Example #3
0
static void
gimp_guide_tool_draw (GimpDrawTool *draw_tool)
{
  GimpGuideTool *guide_tool = GIMP_GUIDE_TOOL (draw_tool);

  if (guide_tool->guide_position != GIMP_GUIDE_POSITION_UNDEFINED)
    {
      /* custom guides are moved live */
      if (! guide_tool->guide_custom)
        gimp_draw_tool_add_guide (draw_tool,
                                  guide_tool->guide_orientation,
                                  guide_tool->guide_position,
                                  GIMP_GUIDE_STYLE_NONE);
    }
}
Example #4
0
static void
gimp_flip_tool_draw (GimpDrawTool *draw_tool)
{
  GimpFlipTool *flip = GIMP_FLIP_TOOL (draw_tool);

  if (flip->guide)
    {
      GimpCanvasItem *item;
      GimpGuideStyle  style;

      style = gimp_guide_get_style (flip->guide);

      item = gimp_draw_tool_add_guide (draw_tool,
                                       gimp_guide_get_orientation (flip->guide),
                                       gimp_guide_get_position (flip->guide),
                                       style);
      gimp_canvas_item_set_highlight (item, TRUE);
    }
}