[gimp] app: add support for cairo polygons



commit 83bab2f0cdbb8b71cbcf6338373406e223698efb
Author: Michael Natterer <mitch gimp org>
Date:   Thu Sep 23 00:00:07 2010 +0200

    app: add support for cairo polygons

 app/tools/gimpdrawtool.c |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)
---
diff --git a/app/tools/gimpdrawtool.c b/app/tools/gimpdrawtool.c
index 16a26f3..e0b4ccf 100644
--- a/app/tools/gimpdrawtool.c
+++ b/app/tools/gimpdrawtool.c
@@ -37,6 +37,7 @@
 #include "display/gimpcanvas.h"
 #include "display/gimpcanvashandle.h"
 #include "display/gimpcanvasline.h"
+#include "display/gimpcanvaspolygon.h"
 #include "display/gimpcanvasrectangle.h"
 #include "display/gimpdisplay.h"
 #include "display/gimpdisplayshell.h"
@@ -1360,9 +1361,20 @@ gimp_draw_tool_draw_lines (GimpDrawTool      *draw_tool,
 
   g_return_if_fail (GIMP_IS_DRAW_TOOL (draw_tool));
 
-  if (points == NULL || n_points == 0)
+  if (points == NULL || n_points < 2)
     return;
 
+  if (draw_tool->use_cairo)
+    {
+      GimpCanvasItem *item;
+
+      item = gimp_canvas_polygon_new (points, n_points, filled);
+
+      draw_tool->items = g_list_append (draw_tool->items, item);
+
+      return;
+    }
+
   shell = gimp_display_get_shell (draw_tool->display);
 
   coords = g_new (GdkPoint, n_points);



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