gimp r26228 - in trunk: . app/vectors
- From: neo svn gnome org
- To: svn-commits-list gnome org
- Subject: gimp r26228 - in trunk: . app/vectors
- Date: Thu, 17 Jul 2008 19:49:40 +0000 (UTC)
Author: neo
Date: Thu Jul 17 19:49:40 2008
New Revision: 26228
URL: http://svn.gnome.org/viewvc/gimp?rev=26228&view=rev
Log:
2008-07-17 Sven Neumann <sven gimp org>
* app/vectors/gimpbezierstroke.c: formatting.
Modified:
trunk/ChangeLog
trunk/app/vectors/gimpbezierstroke.c
Modified: trunk/app/vectors/gimpbezierstroke.c
==============================================================================
--- trunk/app/vectors/gimpbezierstroke.c (original)
+++ trunk/app/vectors/gimpbezierstroke.c Thu Jul 17 19:49:40 2008
@@ -245,11 +245,12 @@
}
static void
-gimp_bezier_stroke_anchor_delete (GimpStroke *stroke,
- GimpAnchor *anchor)
+gimp_bezier_stroke_anchor_delete (GimpStroke *stroke,
+ GimpAnchor *anchor)
{
- GList *list, *list2;
- gint i;
+ GList *list;
+ GList *list2;
+ gint i;
/* Anchors always are surrounded by two handles that have to
* be deleted too */
@@ -271,7 +272,8 @@
gimp_bezier_stroke_open (GimpStroke *stroke,
GimpAnchor *end_anchor)
{
- GList *list, *list2;
+ GList *list;
+ GList *list2;
GimpStroke *new_stroke = NULL;
list = g_list_find (stroke->anchors, end_anchor);
@@ -318,10 +320,12 @@
GimpAnchor *predec,
gdouble position)
{
- GList *segment_start, *list, *list2;
- GimpCoords subdivided[8];
- GimpCoords beziercoords[4];
- gint i;
+ GList *segment_start;
+ GList *list;
+ GList *list2;
+ GimpCoords subdivided[8];
+ GimpCoords beziercoords[4];
+ gint i;
segment_start = g_list_find (stroke->anchors, predec);
@@ -424,10 +428,11 @@
const GimpCoords *deltacoord,
GimpAnchorFeatureType feature)
{
- GimpCoords offsetcoords[2];
- GList *segment_start, *list;
+ GimpCoords offsetcoords[2];
+ GList *segment_start;
+ GList *list;
gint i;
- gdouble feel_good;
+ gdouble feel_good;
segment_start = g_list_find (stroke->anchors, predec);
@@ -480,7 +485,8 @@
GimpCoords deltacoord;
GimpCoords tmp1, tmp2, abs_pos;
GimpCoords beziercoords[4];
- GList *segment_start, *list;
+ GList *segment_start;
+ GList *list;
gint i;
segment_start = g_list_find (stroke->anchors, predec);
@@ -514,7 +520,8 @@
static void
gimp_bezier_stroke_close (GimpStroke *stroke)
{
- GList *start, *end;
+ GList *start;
+ GList *end;
GimpAnchor *anchor;
start = g_list_first (stroke->anchors);
@@ -569,7 +576,8 @@
GimpCoords point;
GimpCoords segmentcoords[4];
GList *anchorlist;
- GimpAnchor *segment_start, *segment_end = NULL;
+ GimpAnchor *segment_start;
+ GimpAnchor *segment_end = NULL;
GimpAnchor *anchor;
gint count;
@@ -671,9 +679,9 @@
*/
GimpCoords subdivided[8];
- gdouble dist1, dist2;
+ gdouble dist1, dist2;
GimpCoords point1, point2;
- gdouble pos1, pos2;
+ gdouble pos1, pos2;
gimp_coords_difference (&beziercoords[1], &beziercoords[0], &point1);
gimp_coords_difference (&beziercoords[3], &beziercoords[2], &point2);
@@ -683,8 +691,8 @@
&& gimp_coords_length_squared (&point2) < precision))
{
GimpCoords line, dcoord;
- gdouble length2, scalar;
- gint i;
+ gdouble length2, scalar;
+ gint i;
gimp_coords_difference (&(beziercoords[3]),
&(beziercoords[0]),
@@ -794,7 +802,8 @@
GimpCoords point;
GimpCoords segmentcoords[4];
GList *anchorlist;
- GimpAnchor *segment_start, *segment_end = NULL;
+ GimpAnchor *segment_start;
+ GimpAnchor *segment_end = NULL;
GimpAnchor *anchor;
gint count;
@@ -889,10 +898,12 @@
GimpCoords *ret_point,
gdouble *ret_pos)
{
- GArray *ret_coords, *ret_params;
- GimpCoords dir, line, dcoord, min_point;
- gdouble min_dist = -1, dist, length2, scalar, ori, ori2;
- gint i;
+ GArray *ret_coords;
+ GArray *ret_params;
+ GimpCoords dir, line, dcoord, min_point;
+ gdouble min_dist = -1;
+ gdouble dist, length2, scalar, ori, ori2;
+ gint i;
gimp_coords_difference (coord2, coord1, &line);
@@ -1274,7 +1285,8 @@
GimpStroke *extension,
GimpAnchor *neighbor)
{
- GList *list1, *list2;
+ GList *list1;
+ GList *list2;
list1 = g_list_find (stroke->anchors, anchor);
list1 = gimp_bezier_stroke_get_anchor_listitem (list1);
@@ -1446,10 +1458,11 @@
static GimpBezierDesc *
gimp_bezier_stroke_make_bezier (const GimpStroke *stroke)
{
- GArray *points, *cmd_array;
- GimpBezierDesc *bezdesc;
+ GArray *points;
+ GArray *cmd_array;
+ GimpBezierDesc *bezdesc;
cairo_path_data_t pathdata;
- gint num_cmds, i;
+ gint num_cmds, i;
points = gimp_stroke_control_points_get (stroke, NULL);
@@ -1701,7 +1714,8 @@
}
static gdouble
-arcto_circleparam (gdouble h, gdouble *y)
+arcto_circleparam (gdouble h,
+ gdouble *y)
{
gdouble t0 = 0.5;
gdouble dt = 0.25;
@@ -1737,7 +1751,9 @@
}
static void
-arcto_subdivide (gdouble t, gint part, GimpCoords *p)
+arcto_subdivide (gdouble t,
+ gint part,
+ GimpCoords *p)
{
GimpCoords p01, p12, p23, p012, p123, p0123;
@@ -2145,7 +2161,7 @@
*/
GimpCoords subdivided[8];
- gdouble middle_t = (start_t + end_t) / 2;
+ gdouble middle_t = (start_t + end_t) / 2;
subdivided[0] = beziercoords[0];
subdivided[6] = beziercoords[3];
@@ -2184,12 +2200,15 @@
precision)) /* 1st half */
{
*ret_coords = g_array_append_vals (*ret_coords, &(subdivided[0]), 3);
+
if (ret_params)
{
gdouble params[3];
+
params[0] = start_t;
params[1] = (2 * start_t + middle_t) / 3;
params[2] = (start_t + 2 * middle_t) / 3;
+
*ret_params = g_array_append_vals (*ret_params, &(params[0]), 3);
}
}
@@ -2205,12 +2224,15 @@
precision)) /* 2nd half */
{
*ret_coords = g_array_append_vals (*ret_coords, &(subdivided[3]), 3);
+
if (ret_params)
{
gdouble params[3];
+
params[0] = middle_t;
params[1] = (2 * middle_t + end_t) / 3;
params[2] = (middle_t + 2 * end_t) / 3;
+
*ret_params = g_array_append_vals (*ret_params, &(params[0]), 3);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]