[gimp] app: remove gimp_draw_tool_draw_dashed_line()



commit dfd5a265ebeea10905e4743f30e204789b4c3c8f
Author: Michael Natterer <mitch gimp org>
Date:   Sat Sep 25 18:04:40 2010 +0200

    app: remove gimp_draw_tool_draw_dashed_line()
    
    Instead, draw a normal line and set the "highlight" property on the
    returned canvas item.

 app/tools/gimpdrawtool.c   |   32 --------------------------------
 app/tools/gimpdrawtool.h   |    5 -----
 app/tools/gimpvectortool.c |    7 ++++++-
 3 files changed, 6 insertions(+), 38 deletions(-)
---
diff --git a/app/tools/gimpdrawtool.c b/app/tools/gimpdrawtool.c
index e67a539..c4ab08a 100644
--- a/app/tools/gimpdrawtool.c
+++ b/app/tools/gimpdrawtool.c
@@ -431,38 +431,6 @@ gimp_draw_tool_draw_line (GimpDrawTool *draw_tool,
 }
 
 /**
- * gimp_draw_tool_draw_dashed_line:
- * @draw_tool:   the #GimpDrawTool
- * @x1:          start point X in image coordinates
- * @y1:          start point Y in image coordinates
- * @x2:          end point X in image coordinates
- * @y2:          end point Y in image coordinates
- *
- * This function takes image space coordinates and transforms them to
- * screen window coordinates, then draws a dashed line between the
- * resulting coordindates.
- **/
-GimpCanvasItem *
-gimp_draw_tool_draw_dashed_line (GimpDrawTool *draw_tool,
-                                 gdouble       x1,
-                                 gdouble       y1,
-                                 gdouble       x2,
-                                 gdouble       y2)
-{
-  GimpCanvasItem *item;
-
-  g_return_val_if_fail (GIMP_IS_DRAW_TOOL (draw_tool), NULL);
-
-  item = gimp_canvas_line_new (x1, y1, x2, y2);
-  gimp_canvas_item_set_highlight (item, TRUE);
-
-  gimp_draw_tool_add_item (draw_tool, item);
-  g_object_unref (item);
-
-  return item;
-}
-
-/**
  * gimp_draw_tool_draw_guide:
  * @draw_tool:   the #GimpDrawTool
  * @orientation: the orientation of the guide line
diff --git a/app/tools/gimpdrawtool.h b/app/tools/gimpdrawtool.h
index d6a36dc..4a473c4 100644
--- a/app/tools/gimpdrawtool.h
+++ b/app/tools/gimpdrawtool.h
@@ -94,11 +94,6 @@ GimpCanvasItem * gimp_draw_tool_draw_line            (GimpDrawTool     *draw_too
                                                       gdouble           y1,
                                                       gdouble           x2,
                                                       gdouble           y2);
-GimpCanvasItem * gimp_draw_tool_draw_dashed_line     (GimpDrawTool     *draw_tool,
-                                                      gdouble           x1,
-                                                      gdouble           y1,
-                                                      gdouble           x2,
-                                                      gdouble           y2);
 GimpCanvasItem * gimp_draw_tool_draw_guide_line      (GimpDrawTool     *draw_tool,
                                                       GimpOrientationType  orientation,
                                                       gint              position);
diff --git a/app/tools/gimpvectortool.c b/app/tools/gimpvectortool.c
index b88bc2a..7f9c5d5 100644
--- a/app/tools/gimpvectortool.c
+++ b/app/tools/gimpvectortool.c
@@ -48,6 +48,7 @@
 #include "widgets/gimphelp-ids.h"
 #include "widgets/gimpwidgets-utils.h"
 
+#include "display/gimpcanvasitem.h"
 #include "display/gimpdisplay.h"
 #include "display/gimpdisplayshell.h"
 #include "display/gimpdisplayshell-scale.h"
@@ -1468,12 +1469,16 @@ gimp_vector_tool_draw (GimpDrawTool *draw_tool)
 
                   for (i = 0; i < coords->len; i += 2)
                     {
-                      gimp_draw_tool_draw_dashed_line
+                      GimpCanvasItem *item;
+
+                      item = gimp_draw_tool_draw_line
                         (draw_tool,
                          g_array_index (coords, GimpCoords, i).x,
                          g_array_index (coords, GimpCoords, i).y,
                          g_array_index (coords, GimpCoords, i + 1).x,
                          g_array_index (coords, GimpCoords, i + 1).y);
+
+                      gimp_canvas_item_set_highlight (item, TRUE);
                     }
                 }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]