[gimp] app: add support for cairo arcs



commit 67708a65a128e93d16eb948c43b7dac1cd181478
Author: Michael Natterer <mitch gimp org>
Date:   Fri Sep 24 18:42:36 2010 +0200

    app: add support for cairo arcs

 app/tools/gimpdrawtool.c |   21 +++++++++++++++++++++
 1 files changed, 21 insertions(+), 0 deletions(-)
---
diff --git a/app/tools/gimpdrawtool.c b/app/tools/gimpdrawtool.c
index b04efc1..5f4ac8f 100644
--- a/app/tools/gimpdrawtool.c
+++ b/app/tools/gimpdrawtool.c
@@ -35,6 +35,7 @@
 #include "vectors/gimpvectors.h"
 
 #include "display/gimpcanvas.h"
+#include "display/gimpcanvasarc.h"
 #include "display/gimpcanvasboundary.h"
 #include "display/gimpcanvascorner.h"
 #include "display/gimpcanvasguide.h"
@@ -630,6 +631,26 @@ gimp_draw_tool_draw_arc (GimpDrawTool *draw_tool,
 
   g_return_if_fail (GIMP_IS_DRAW_TOOL (draw_tool));
 
+  if (draw_tool->use_cairo)
+    {
+      GimpCanvasItem *item;
+      gdouble         a1, a2;
+
+      a1 = (gdouble) angle1 / 64.0 / 180.0 * G_PI;
+      a2 = (gdouble) angle2 / 64.0 / 180.0 * G_PI;
+
+      item = gimp_canvas_arc_new (x + width  / 2.0,
+                                  y + height / 2.0,
+                                  width  / 2.0,
+                                  height / 2.0,
+                                  a1, a2,
+                                  FALSE);
+
+      draw_tool->items = g_list_append (draw_tool->items, item);
+
+      return;
+    }
+
   shell = gimp_display_get_shell (draw_tool->display);
 
   gimp_display_shell_transform_xy_f (shell,



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