From 138bab295bbcce373d98dff2f0b5d7275351a0cc Mon Sep 17 00:00:00 2001 From: Sven Neumann Date: Tue, 2 Sep 2003 16:13:48 +0000 Subject: [PATCH] added new function gimp_draw_tool_draw_dashed_line(). 2003-09-02 Sven Neumann * app/tools/gimpdrawtool.[ch]: added new function gimp_draw_tool_draw_dashed_line(). --- ChangeLog | 5 +++++ app/tools/gimpdrawtool.c | 19 +++++++++++++++++++ app/tools/gimpdrawtool.h | 6 ++++++ 3 files changed, 30 insertions(+) diff --git a/ChangeLog b/ChangeLog index e87f13dbc6..cf397374c4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2003-09-02 Sven Neumann + + * app/tools/gimpdrawtool.[ch]: added new function + gimp_draw_tool_draw_dashed_line(). + 2003-09-02 Michael Natterer * app/widgets/gimpdockable.c (gimp_dockable_init): default to diff --git a/app/tools/gimpdrawtool.c b/app/tools/gimpdrawtool.c index bd9782e971..eebf57ce00 100644 --- a/app/tools/gimpdrawtool.c +++ b/app/tools/gimpdrawtool.c @@ -344,6 +344,25 @@ gimp_draw_tool_draw_line (GimpDrawTool *draw_tool, RINT (tx2), RINT (ty2)); } +void +gimp_draw_tool_draw_dashed_line (GimpDrawTool *draw_tool, + gdouble x1, + gdouble y1, + gdouble x2, + gdouble y2, + gboolean use_offsets) +{ + GdkGCValues values; + + values.line_style = GDK_LINE_ON_OFF_DASH; + gdk_gc_set_values (draw_tool->gc, &values, GDK_GC_LINE_STYLE); + + gimp_draw_tool_draw_line (draw_tool, x1, y1, x2, y2, use_offsets); + + values.line_style = GDK_LINE_SOLID; + gdk_gc_set_values (draw_tool->gc, &values, GDK_GC_LINE_STYLE); +} + void gimp_draw_tool_draw_rectangle (GimpDrawTool *draw_tool, gboolean filled, diff --git a/app/tools/gimpdrawtool.h b/app/tools/gimpdrawtool.h index 018a3b8b15..193d734d7d 100644 --- a/app/tools/gimpdrawtool.h +++ b/app/tools/gimpdrawtool.h @@ -102,6 +102,12 @@ void gimp_draw_tool_draw_line (GimpDrawTool *draw_tool, gdouble x2, gdouble y2, gboolean use_offsets); +void gimp_draw_tool_draw_dashed_line (GimpDrawTool *draw_tool, + gdouble x1, + gdouble y1, + gdouble x2, + gdouble y2, + gboolean use_offsets); void gimp_draw_tool_draw_rectangle (GimpDrawTool *draw_tool, gboolean filled, gdouble x,