gimp r27702 - in trunk: . app/tools
- From: neo svn gnome org
- To: svn-commits-list gnome org
- Subject: gimp r27702 - in trunk: . app/tools
- Date: Fri, 21 Nov 2008 21:07:48 +0000 (UTC)
Author: neo
Date: Fri Nov 21 21:07:48 2008
New Revision: 27702
URL: http://svn.gnome.org/viewvc/gimp?rev=27702&view=rev
Log:
2008-11-21 Sven Neumann <sven gimp org>
* app/tools/gimpdrawtool.c (gimp_draw_tool_real_draw): moved
vectors drawing to its own function.
Modified:
trunk/ChangeLog
trunk/app/tools/gimpdrawtool.c
Modified: trunk/app/tools/gimpdrawtool.c
==============================================================================
--- trunk/app/tools/gimpdrawtool.c (original)
+++ trunk/app/tools/gimpdrawtool.c Fri Nov 21 21:07:48 2008
@@ -43,35 +43,38 @@
#include "gimpdrawtool.h"
-static void gimp_draw_tool_finalize (GObject *object);
+static void gimp_draw_tool_finalize (GObject *object);
-static gboolean gimp_draw_tool_has_display (GimpTool *tool,
- GimpDisplay *display);
-static GimpDisplay * gimp_draw_tool_has_image (GimpTool *tool,
- GimpImage *image);
-static void gimp_draw_tool_control (GimpTool *tool,
- GimpToolAction action,
- GimpDisplay *display);
+static gboolean gimp_draw_tool_has_display (GimpTool *tool,
+ GimpDisplay *display);
+static GimpDisplay * gimp_draw_tool_has_image (GimpTool *tool,
+ GimpImage *image);
+static void gimp_draw_tool_control (GimpTool *tool,
+ GimpToolAction action,
+ GimpDisplay *display);
-static void gimp_draw_tool_draw (GimpDrawTool *draw_tool);
-static void gimp_draw_tool_real_draw (GimpDrawTool *draw_tool);
+static void gimp_draw_tool_draw (GimpDrawTool *draw_tool);
+static void gimp_draw_tool_real_draw (GimpDrawTool *draw_tool);
+
+static void gimp_draw_tool_draw_vectors (GimpDrawTool *draw_tool,
+ GList *vectors);
static inline void gimp_draw_tool_shift_to_north_west
- (gdouble x,
- gdouble y,
- gint handle_width,
- gint handle_height,
- GtkAnchorType anchor,
- gdouble *shifted_x,
- gdouble *shifted_y);
+ (gdouble x,
+ gdouble y,
+ gint handle_width,
+ gint handle_height,
+ GtkAnchorType anchor,
+ gdouble *shifted_x,
+ gdouble *shifted_y);
static inline void gimp_draw_tool_shift_to_center
- (gdouble x,
- gdouble y,
- gint handle_width,
- gint handle_height,
- GtkAnchorType anchor,
- gdouble *shifted_x,
- gdouble *shifted_y);
+ (gdouble x,
+ gdouble y,
+ gint handle_width,
+ gint handle_height,
+ GtkAnchorType anchor,
+ gdouble *shifted_x,
+ gdouble *shifted_y);
G_DEFINE_TYPE (GimpDrawTool, gimp_draw_tool, GIMP_TYPE_TOOL)
@@ -198,49 +201,8 @@
static void
gimp_draw_tool_real_draw (GimpDrawTool *draw_tool)
{
- GList *list;
-
- if (! draw_tool->vectors)
- return;
-
- for (list = draw_tool->vectors; list; list = g_list_next (list))
- {
- GimpVectors *vectors = list->data;
- GimpStroke *stroke = NULL;
-
- while ((stroke = gimp_vectors_stroke_get_next (vectors, stroke)))
- {
- GArray *coords;
- gboolean closed;
-
- coords = gimp_stroke_interpolate (stroke, 1.0, &closed);
-
- if (coords && coords->len)
- {
- if (draw_tool->transform)
- {
- gint i;
-
- for (i = 0; i < coords->len; i++)
- {
- GimpCoords *curr = &g_array_index (coords, GimpCoords, i);
-
- gimp_matrix3_transform_point (draw_tool->transform,
- curr->x, curr->y,
- &curr->x, &curr->y);
- }
- }
-
- gimp_draw_tool_draw_strokes (draw_tool,
- &g_array_index (coords,
- GimpCoords, 0),
- coords->len, FALSE, FALSE);
- }
-
- if (coords)
- g_array_free (coords, TRUE);
- }
- }
+ if (draw_tool->vectors)
+ gimp_draw_tool_draw_vectors (draw_tool, draw_tool->vectors);
}
void
@@ -1618,6 +1580,53 @@
PROJ_ROUND (tx2) + 3, PROJ_ROUND (ty2) - 2);
}
+/* This is called from gimp_draw_tool_real_draw() */
+static void
+gimp_draw_tool_draw_vectors (GimpDrawTool *draw_tool,
+ GList *vectors)
+{
+ GList *list;
+
+ for (list = vectors; list; list = g_list_next (list))
+ {
+ GimpVectors *vectors = list->data;
+ GimpStroke *stroke = NULL;
+
+ while ((stroke = gimp_vectors_stroke_get_next (vectors, stroke)))
+ {
+ GArray *coords;
+ gboolean closed;
+
+ coords = gimp_stroke_interpolate (stroke, 1.0, &closed);
+
+ if (coords && coords->len)
+ {
+ if (draw_tool->transform)
+ {
+ gint i;
+
+ for (i = 0; i < coords->len; i++)
+ {
+ GimpCoords *curr = &g_array_index (coords, GimpCoords, i);
+
+ gimp_matrix3_transform_point (draw_tool->transform,
+ curr->x, curr->y,
+ &curr->x, &curr->y);
+ }
+ }
+
+ gimp_draw_tool_draw_strokes (draw_tool,
+ &g_array_index (coords,
+ GimpCoords, 0),
+ coords->len, FALSE, FALSE);
+ }
+
+ if (coords)
+ g_array_free (coords, TRUE);
+ }
+ }
+}
+
gboolean
gimp_draw_tool_on_handle (GimpDrawTool *draw_tool,
GimpDisplay *display,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]