~ubuntu-branches/ubuntu/jaunty/gimp/jaunty-security

« back to all changes in this revision

Viewing changes to plug-ins/gfig/gfig-star.c

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Holbach
  • Date: 2007-05-02 16:33:03 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20070502163303-bvzhjzbpw8qglc4y
Tags: 2.3.16-1ubuntu1
* Resynchronized with Debian, remaining Ubuntu changes:
  - debian/rules: i18n magic.
* debian/control.in:
  - Maintainer: Ubuntu Core Developers <ubuntu-devel@lists.ubuntu.com>
* debian/patches/02_help-message.patch,
  debian/patches/03_gimp.desktop.in.in.patch,
  debian/patches/10_dont_show_wizard.patch: updated.
* debian/patches/04_composite-signedness.patch,
  debian/patches/05_add-letter-spacing.patch: dropped, used upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
 
26
26
#include "config.h"
27
27
 
28
 
#include <math.h>
29
 
#include <stdio.h>
30
 
#include <string.h>
31
 
 
32
 
#include <gtk/gtk.h>
33
 
 
34
28
#include <libgimp/gimp.h>
35
29
#include <libgimp/gimpui.h>
36
30
 
37
31
#include "gfig.h"
38
32
#include "gfig-line.h"
39
33
#include "gfig-dobject.h"
 
34
#include "gfig-star.h"
40
35
#include "gfig-dialog.h"
41
36
 
42
37
#include "libgimp/stdplugins-intl.h"
73
68
  gdouble     inner_radius;
74
69
  gdouble     offset_angle;
75
70
  gint        loop;
76
 
  GdkPoint    start_pnt;
77
 
  GdkPoint    first_pnt;
 
71
  GdkPoint    start_pnt = { 0, 0 };
 
72
  GdkPoint    first_pnt = { 0, 0 };
78
73
  gboolean    do_line = FALSE;
79
74
 
80
75
  center_pnt = obj->points;
188
183
  gdouble     inner_radius;
189
184
  gdouble     offset_angle;
190
185
  gint        loop;
191
 
  GdkPoint    first_pnt, last_pnt;
 
186
  GdkPoint    first_pnt = { 0, 0 };
 
187
  GdkPoint    last_pnt  = { 0, 0 };
192
188
  gboolean    first = TRUE;
 
189
  gdouble    *min_max;
193
190
 
194
191
  g_assert (obj != NULL);
195
192
 
202
199
    return; /* no-line */
203
200
 
204
201
  line_pnts = g_new0 (gdouble, 2 * seg_count + 1);
 
202
  min_max = g_new (gdouble, 4);
205
203
 
206
204
  /* Go around all the points drawing a line from one to the next */
207
205
  /* Next point defines the radius */
277
275
        {
278
276
          first_pnt = calc_pnt;
279
277
          first = FALSE;
 
278
          min_max[0] = min_max[2] = calc_pnt.x;
 
279
          min_max[1] = min_max[3] = calc_pnt.y;
 
280
        }
 
281
      else
 
282
        {
 
283
          min_max[0] = MIN (min_max[0], calc_pnt.x);
 
284
          min_max[1] = MIN (min_max[1], calc_pnt.y);
 
285
          min_max[2] = MAX (min_max[2], calc_pnt.x);
 
286
          min_max[3] = MAX (min_max[3], calc_pnt.y);
280
287
        }
281
288
    }
282
289
 
285
292
 
286
293
  /* Scale before drawing */
287
294
  if (selvals.scaletoimage)
288
 
    scale_to_original_xy (&line_pnts[0], i / 2);
 
295
    {
 
296
      scale_to_original_xy (&line_pnts[0], i / 2);
 
297
      scale_to_original_xy (min_max, 2);
 
298
    }
289
299
  else
290
 
    scale_to_xy (&line_pnts[0], i / 2);
 
300
    {
 
301
      scale_to_xy (&line_pnts[0], i / 2);
 
302
      scale_to_xy (min_max, 2);
 
303
    }
291
304
 
292
305
  gimp_free_select (gfig_context->image_id,
293
306
                    i, line_pnts,
296
309
                    selopt.feather,
297
310
                    selopt.feather_radius);
298
311
 
299
 
  paint_layer_fill ();
 
312
  paint_layer_fill (min_max[0], min_max[1], min_max[2], min_max[3]);
300
313
 
301
314
  if (obj->style.paint_type == PAINT_BRUSH_TYPE)
302
315
    gimp_edit_stroke (gfig_context->drawable_id);
303
316
 
304
317
  g_free (line_pnts);
 
318
  g_free (min_max);
305
319
}
306
320
 
307
321
static GfigObject *