Commit 8f4adbad authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

app/gimpbrush.[ch] app/gimpbrushgenerated.[ch] app/gimpbrushlist.[ch]

2000-02-24  Michael Natterer  <mitch@gimp.org>

	* app/gimpbrush.[ch]
	* app/gimpbrushgenerated.[ch]
	* app/gimpbrushlist.[ch]
	* app/gimpbrushlistP.h
	* app/gimpbrushpipe.[ch]
	* app/gimpbrushpipeP.h: did a brushes code-review: indentation,
	removed some includes, didn't find a bug :-)

	* app/gradient.c
	* app/palette.c: we were leaking all gradient and palette preview
	pixmaps as well as all lists of palette colors on each refresh.

	* libgimp/gimpenv.c: updated documentation.
parent ae38b99c
2000-02-24 Michael Natterer <mitch@gimp.org>
* app/gimpbrush.[ch]
* app/gimpbrushgenerated.[ch]
* app/gimpbrushlist.[ch]
* app/gimpbrushlistP.h
* app/gimpbrushpipe.[ch]
* app/gimpbrushpipeP.h: did a brushes code-review: indentation,
removed some includes, didn't find a bug :-)
* app/gradient.c
* app/palette.c: we were leaking all gradient and palette preview
pixmaps as well as all lists of palette colors on each refresh.
* libgimp/gimpenv.c: updated documentation.
2000-02-24 Michael Natterer <mitch@gimp.org>
* app/tool_options.c: another leak: don't allocate the
......
......@@ -39,7 +39,8 @@ static GimpBrush * gimp_brush_select_brush (PaintCore *paint_core);
static gboolean gimp_brush_want_null_motion (PaintCore *paint_core);
static guint gimp_brush_signals[LAST_SIGNAL];
static GimpObjectClass* parent_class;
static GimpObjectClass *parent_class;
static void
gimp_brush_destroy (GtkObject *object)
......@@ -53,7 +54,8 @@ gimp_brush_destroy (GtkObject *object)
if (brush->mask)
temp_buf_free (brush->mask);
GTK_OBJECT_CLASS (parent_class)->destroy (object);
if (GTK_OBJECT_CLASS (parent_class)->destroy)
(* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
}
static void
......@@ -62,13 +64,13 @@ gimp_brush_class_init (GimpBrushClass *klass)
GtkObjectClass *object_class;
GtkType type;
object_class = GTK_OBJECT_CLASS(klass);
object_class = GTK_OBJECT_CLASS (klass);
parent_class = gtk_type_class (gimp_object_get_type ());
type=object_class->type;
type = object_class->type;
object_class->destroy = gimp_brush_destroy;
object_class->destroy = gimp_brush_destroy;
klass->select_brush = gimp_brush_select_brush;
klass->want_null_motion = gimp_brush_want_null_motion;
......@@ -122,7 +124,7 @@ gimp_brush_get_type (void)
GimpBrush *
gimp_brush_new (gchar *filename)
{
GimpBrush *brush = GIMP_BRUSH (gtk_type_new (gimp_brush_get_type ()));
GimpBrush *brush = GIMP_BRUSH (gtk_type_new (gimp_brush_get_type ()));
gimp_brush_load (brush, filename);
......@@ -149,7 +151,7 @@ gimp_brush_get_mask (GimpBrush *brush)
return brush->mask;
}
char *
gchar *
gimp_brush_get_name (GimpBrush *brush)
{
g_return_val_if_fail (GIMP_IS_BRUSH (brush), NULL);
......@@ -206,7 +208,7 @@ gimp_brush_load (GimpBrush *brush,
return;
}
gimp_brush_load_brush(brush,fp,filename);
gimp_brush_load_brush (brush, fp, filename);
/* Clean up */
fclose (fp);
......@@ -216,7 +218,6 @@ gimp_brush_load (GimpBrush *brush,
temp_buf_swap (brush->mask);
}
gint
gimp_brush_load_brush (GimpBrush *brush,
FILE *fp,
......@@ -304,4 +305,3 @@ gimp_brush_load_brush (GimpBrush *brush,
}
return 1;
}
......@@ -39,7 +39,8 @@ static GimpBrush * gimp_brush_select_brush (PaintCore *paint_core);
static gboolean gimp_brush_want_null_motion (PaintCore *paint_core);
static guint gimp_brush_signals[LAST_SIGNAL];
static GimpObjectClass* parent_class;
static GimpObjectClass *parent_class;
static void
gimp_brush_destroy (GtkObject *object)
......@@ -53,7 +54,8 @@ gimp_brush_destroy (GtkObject *object)
if (brush->mask)
temp_buf_free (brush->mask);
GTK_OBJECT_CLASS (parent_class)->destroy (object);
if (GTK_OBJECT_CLASS (parent_class)->destroy)
(* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
}
static void
......@@ -62,13 +64,13 @@ gimp_brush_class_init (GimpBrushClass *klass)
GtkObjectClass *object_class;
GtkType type;
object_class = GTK_OBJECT_CLASS(klass);
object_class = GTK_OBJECT_CLASS (klass);
parent_class = gtk_type_class (gimp_object_get_type ());
type=object_class->type;
type = object_class->type;
object_class->destroy = gimp_brush_destroy;
object_class->destroy = gimp_brush_destroy;
klass->select_brush = gimp_brush_select_brush;
klass->want_null_motion = gimp_brush_want_null_motion;
......@@ -122,7 +124,7 @@ gimp_brush_get_type (void)
GimpBrush *
gimp_brush_new (gchar *filename)
{
GimpBrush *brush = GIMP_BRUSH (gtk_type_new (gimp_brush_get_type ()));
GimpBrush *brush = GIMP_BRUSH (gtk_type_new (gimp_brush_get_type ()));
gimp_brush_load (brush, filename);
......@@ -149,7 +151,7 @@ gimp_brush_get_mask (GimpBrush *brush)
return brush->mask;
}
char *
gchar *
gimp_brush_get_name (GimpBrush *brush)
{
g_return_val_if_fail (GIMP_IS_BRUSH (brush), NULL);
......@@ -206,7 +208,7 @@ gimp_brush_load (GimpBrush *brush,
return;
}
gimp_brush_load_brush(brush,fp,filename);
gimp_brush_load_brush (brush, fp, filename);
/* Clean up */
fclose (fp);
......@@ -216,7 +218,6 @@ gimp_brush_load (GimpBrush *brush,
temp_buf_swap (brush->mask);
}
gint
gimp_brush_load_brush (GimpBrush *brush,
FILE *fp,
......@@ -304,4 +305,3 @@ gimp_brush_load_brush (GimpBrush *brush,
}
return 1;
}
......@@ -29,7 +29,7 @@
struct _GimpBrush
{
GimpObject gobject;
GimpObject gobject;
gchar *filename; /* actual filename--brush's location on disk */
gchar *name; /* brush's name--for brush selection dialog */
......@@ -43,33 +43,31 @@ struct _GimpBrushClass
{
GimpObjectClass parent_class;
GimpBrush * (* select_brush) (PaintCore *);
gboolean (* want_null_motion) (PaintCore *);
GimpBrush * (* select_brush) (PaintCore *paint_core);
gboolean (* want_null_motion) (PaintCore *paint_core);
};
#define GIMP_BRUSH_CLASS(klass) \
GTK_CHECK_CLASS_CAST (klass, gimp_brush_get_type(), GimpBrushClass)
#define GIMP_TYPE_BRUSH (gimp_brush_get_type ())
#define GIMP_BRUSH(obj) (GIMP_CHECK_CAST ((obj), GIMP_TYPE_BRUSH, GimpBrush))
#define GIMP_IS_BRUSH(obj) (GIMP_CHECK_TYPE ((obj), GIMP_TYPE_BRUSH))
#define GIMP_BRUSH_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, gimp_brush_get_type(), GimpBrushClass)
#define GIMP_TYPE_BRUSH (gimp_brush_get_type ())
#define GIMP_BRUSH(obj) (GIMP_CHECK_CAST ((obj), GIMP_TYPE_BRUSH, GimpBrush))
#define GIMP_IS_BRUSH(obj) (GIMP_CHECK_TYPE ((obj), GIMP_TYPE_BRUSH))
GtkType gimp_brush_get_type (void);
GimpBrush * gimp_brush_new (gchar *filename);
void gimp_brush_load (GimpBrush *brush,
gchar *filename);
int gimp_brush_load_brush (GimpBrush *brush,
gint gimp_brush_load_brush (GimpBrush *brush,
FILE *fp,
gchar *filename);
TempBuf * gimp_brush_get_mask (GimpBrush *brush);
char * gimp_brush_get_name (GimpBrush *brush);
gchar * gimp_brush_get_name (GimpBrush *brush);
void gimp_brush_set_name (GimpBrush *brush,
gchar *name);
int gimp_brush_get_spacing (GimpBrush *brush);
gint gimp_brush_get_spacing (GimpBrush *brush);
void gimp_brush_set_spacing (GimpBrush *brush,
gint spacing);
......
......@@ -38,33 +38,34 @@
static void gimp_brush_generated_generate (GimpBrushGenerated *brush);
static GimpObjectClass* parent_class;
static GimpObjectClass *parent_class;
static void
gimp_brush_generated_destroy (GtkObject *object)
{
GTK_OBJECT_CLASS(parent_class)->destroy (object);
if (GTK_OBJECT_CLASS (parent_class)->destroy)
(* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
}
static void
gimp_brush_generated_class_init (GimpBrushGeneratedClass *klass)
{
GtkObjectClass *object_class;
object_class = GTK_OBJECT_CLASS (klass);
parent_class = gtk_type_class (GIMP_TYPE_BRUSH);
object_class->destroy = gimp_brush_generated_destroy;
object_class->destroy = gimp_brush_generated_destroy;
}
static void
gimp_brush_generated_init (GimpBrushGenerated *brush)
{
brush->radius = 5.0;
brush->hardness = 0.0;
brush->angle = 0.0;
brush->aspect_ratio = 1.0;
brush->freeze = 0;
brush->radius = 5.0;
brush->hardness = 0.0;
brush->angle = 0.0;
brush->aspect_ratio = 1.0;
brush->freeze = 0;
}
guint
......@@ -86,7 +87,7 @@ gimp_brush_generated_get_type (void)
(GtkClassInitFunc) NULL
};
type = gtk_type_unique(GIMP_TYPE_BRUSH, &info);
type = gtk_type_unique (GIMP_TYPE_BRUSH, &info);
}
return type;
......@@ -123,12 +124,12 @@ GimpBrushGenerated *
gimp_brush_generated_load (const gchar *file_name)
{
GimpBrushGenerated *brush;
FILE *fp;
gchar string[256];
gfloat fl;
gfloat version;
FILE *fp;
gchar string[256];
gfloat fl;
gfloat version;
if ((fp = fopen(file_name, "rb")) == NULL)
if ((fp = fopen (file_name, "rb")) == NULL)
return NULL;
/* make sure the file we are reading is the right type */
......@@ -191,7 +192,7 @@ gimp_brush_generated_save (GimpBrushGenerated *brush,
if ((fp = fopen (file_name, "wb")) == NULL)
{
g_warning("Unable to save file %s", file_name);
g_warning ("Unable to save file %s", file_name);
return;
}
......@@ -260,28 +261,29 @@ gauss (gdouble f)
if (f < -.5)
{
f = -1.0-f;
return (2.0*f*f);
return (2.0 * f*f);
}
if (f < .5)
return (1.0-2.0*f*f);
return (1.0 - 2.0 * f*f);
f = 1.0 -f;
return (2.0*f*f);
return (2.0 * f*f);
}
void
gimp_brush_generated_generate (GimpBrushGenerated *brush)
{
register GimpBrush *gbrush = NULL;
register int x, y;
register gint x, y;
register guchar *centerp;
register double d;
register double exponent;
register gdouble d;
register gdouble exponent;
register guchar a;
register int length;
register gint length;
register guchar *lookup;
double buffer[OVERSAMPLING];
register double sum, c, s, tx, ty;
int width, height;
gdouble buffer[OVERSAMPLING];
register gdouble sum, c, s, tx, ty;
gint width, height;
g_return_if_fail (brush != NULL);
g_return_if_fail (GIMP_IS_BRUSH_GENERATED (brush));
......@@ -352,9 +354,9 @@ gimp_brush_generated_generate (GimpBrushGenerated *brush)
buffer[x%OVERSAMPLING] = 0.0;
else
/* buffer[x%OVERSAMPLING] = (1.0 - pow (d/brush->radius, exponent)); */
buffer[x%OVERSAMPLING] = gauss (pow (d/brush->radius, exponent));
buffer[x%OVERSAMPLING] = gauss (pow (d/brush->radius, exponent));
sum += buffer[x%OVERSAMPLING];
lookup[x++] = RINT (sum*(255.0/OVERSAMPLING));
lookup[x++] = RINT (sum*(255.0/OVERSAMPLING));
}
while (x < length)
{
......@@ -389,7 +391,7 @@ gimp_brush_generated_set_radius (GimpBrushGenerated *brush,
if (radius < 0.0)
radius = 0.0;
else if(radius > 32767.0)
else if (radius > 32767.0)
radius = 32767.0;
if (radius == brush->radius)
return radius;
......
......@@ -38,33 +38,34 @@
static void gimp_brush_generated_generate (GimpBrushGenerated *brush);
static GimpObjectClass* parent_class;
static GimpObjectClass *parent_class;
static void
gimp_brush_generated_destroy (GtkObject *object)
{
GTK_OBJECT_CLASS(parent_class)->destroy (object);
if (GTK_OBJECT_CLASS (parent_class)->destroy)
(* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
}
static void
gimp_brush_generated_class_init (GimpBrushGeneratedClass *klass)
{
GtkObjectClass *object_class;
object_class = GTK_OBJECT_CLASS (klass);
parent_class = gtk_type_class (GIMP_TYPE_BRUSH);
object_class->destroy = gimp_brush_generated_destroy;
object_class->destroy = gimp_brush_generated_destroy;
}
static void
gimp_brush_generated_init (GimpBrushGenerated *brush)
{
brush->radius = 5.0;
brush->hardness = 0.0;
brush->angle = 0.0;
brush->aspect_ratio = 1.0;
brush->freeze = 0;
brush->radius = 5.0;
brush->hardness = 0.0;
brush->angle = 0.0;
brush->aspect_ratio = 1.0;
brush->freeze = 0;
}
guint
......@@ -86,7 +87,7 @@ gimp_brush_generated_get_type (void)
(GtkClassInitFunc) NULL
};
type = gtk_type_unique(GIMP_TYPE_BRUSH, &info);
type = gtk_type_unique (GIMP_TYPE_BRUSH, &info);
}
return type;
......@@ -123,12 +124,12 @@ GimpBrushGenerated *
gimp_brush_generated_load (const gchar *file_name)
{
GimpBrushGenerated *brush;
FILE *fp;
gchar string[256];
gfloat fl;
gfloat version;
FILE *fp;
gchar string[256];
gfloat fl;
gfloat version;
if ((fp = fopen(file_name, "rb")) == NULL)
if ((fp = fopen (file_name, "rb")) == NULL)
return NULL;
/* make sure the file we are reading is the right type */
......@@ -191,7 +192,7 @@ gimp_brush_generated_save (GimpBrushGenerated *brush,
if ((fp = fopen (file_name, "wb")) == NULL)
{
g_warning("Unable to save file %s", file_name);
g_warning ("Unable to save file %s", file_name);
return;
}
......@@ -260,28 +261,29 @@ gauss (gdouble f)
if (f < -.5)
{
f = -1.0-f;
return (2.0*f*f);
return (2.0 * f*f);
}
if (f < .5)
return (1.0-2.0*f*f);
return (1.0 - 2.0 * f*f);
f = 1.0 -f;
return (2.0*f*f);
return (2.0 * f*f);
}
void
gimp_brush_generated_generate (GimpBrushGenerated *brush)
{
register GimpBrush *gbrush = NULL;
register int x, y;
register gint x, y;
register guchar *centerp;
register double d;
register double exponent;
register gdouble d;
register gdouble exponent;
register guchar a;
register int length;
register gint length;
register guchar *lookup;
double buffer[OVERSAMPLING];
register double sum, c, s, tx, ty;
int width, height;
gdouble buffer[OVERSAMPLING];
register gdouble sum, c, s, tx, ty;
gint width, height;
g_return_if_fail (brush != NULL);
g_return_if_fail (GIMP_IS_BRUSH_GENERATED (brush));
......@@ -352,9 +354,9 @@ gimp_brush_generated_generate (GimpBrushGenerated *brush)
buffer[x%OVERSAMPLING] = 0.0;
else
/* buffer[x%OVERSAMPLING] = (1.0 - pow (d/brush->radius, exponent)); */
buffer[x%OVERSAMPLING] = gauss (pow (d/brush->radius, exponent));
buffer[x%OVERSAMPLING] = gauss (pow (d/brush->radius, exponent));
sum += buffer[x%OVERSAMPLING];
lookup[x++] = RINT (sum*(255.0/OVERSAMPLING));
lookup[x++] = RINT (sum*(255.0/OVERSAMPLING));
}
while (x < length)
{
......@@ -389,7 +391,7 @@ gimp_brush_generated_set_radius (GimpBrushGenerated *brush,
if (radius < 0.0)
radius = 0.0;
else if(radius > 32767.0)
else if (radius > 32767.0)
radius = 32767.0;
if (radius == brush->radius)
return radius;
......
......@@ -38,33 +38,34 @@
static void gimp_brush_generated_generate (GimpBrushGenerated *brush);
static GimpObjectClass* parent_class;
static GimpObjectClass *parent_class;
static void
gimp_brush_generated_destroy (GtkObject *object)
{
GTK_OBJECT_CLASS(parent_class)->destroy (object);
if (GTK_OBJECT_CLASS (parent_class)->destroy)
(* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
}
static void
gimp_brush_generated_class_init (GimpBrushGeneratedClass *klass)
{
GtkObjectClass *object_class;
object_class = GTK_OBJECT_CLASS (klass);
parent_class = gtk_type_class (GIMP_TYPE_BRUSH);
object_class->destroy = gimp_brush_generated_destroy;
object_class->destroy = gimp_brush_generated_destroy;
}
static void
gimp_brush_generated_init (GimpBrushGenerated *brush)
{
brush->radius = 5.0;
brush->hardness = 0.0;
brush->angle = 0.0;
brush->aspect_ratio = 1.0;
brush->freeze = 0;
brush->radius = 5.0;
brush->hardness = 0.0;
brush->angle = 0.0;
brush->aspect_ratio = 1.0;
brush->freeze = 0;
}
guint
......@@ -86,7 +87,7 @@ gimp_brush_generated_get_type (void)
(GtkClassInitFunc) NULL
};
type = gtk_type_unique(GIMP_TYPE_BRUSH, &info);
type = gtk_type_unique (GIMP_TYPE_BRUSH, &info);
}
return type;
......@@ -123,12 +124,12 @@ GimpBrushGenerated *
gimp_brush_generated_load (const gchar *file_name)
{
GimpBrushGenerated *brush;
FILE *fp;
gchar string[256];
gfloat fl;
gfloat version;
FILE *fp;
gchar string[256];
gfloat fl;
gfloat version;
if ((fp = fopen(file_name, "rb")) == NULL)
if ((fp = fopen (file_name, "rb")) == NULL)
return NULL;
/* make sure the file we are reading is the right type */
......@@ -191,7 +192,7 @@ gimp_brush_generated_save (GimpBrushGenerated *brush,
if ((fp = fopen (file_name, "wb")) == NULL)
{
g_warning("Unable to save file %s", file_name);
g_warning ("Unable to save file %s", file_name);
return;
}
......@@ -260,28 +261,29 @@ gauss (gdouble f)
if (f < -.5)
{
f = -1.0-f;
return (2.0*f*f);
return (2.0 * f*f);
}
if (f < .5)
return (1.0-2.0*f*f);
return (1.0 - 2.0 * f*f);
f = 1.0 -f;
return (2.0*f*f);
return (2.0 * f*f);
}
void
gimp_brush_generated_generate (GimpBrushGenerated *brush)
{
register GimpBrush *gbrush = NULL;
register int x, y;
register gint x, y;
register guchar *centerp;
register double d;
register double exponent;
register gdouble d;
register gdouble exponent;
register guchar a;
register int length;
register gint length;
register guchar *lookup;
double buffer[OVERSAMPLING];
register double sum, c, s, tx, ty;
int width, height;
gdouble buffer[OVERSAMPLING];
register gdouble sum, c, s, tx, ty;
gint width, height;
g_return_if_fail (brush != NULL);
g_return_if_fail (GIMP_IS_BRUSH_GENERATED (brush));
......@@ -352,9 +354,9 @@ gimp_brush_generated_generate (GimpBrushGenerated *brush)
buffer[x%OVERSAMPLING] = 0.0;
else
/* buffer[x%OVERSAMPLING] = (1.0 - pow (d/brush->radius, exponent)); */
buffer[x%OVERSAMPLING] = gauss (pow (d/brush->radius, exponent));
buffer[x%OVERSAMPLING] = gauss (pow (d/brush->radius, exponent));
sum += buffer[x%OVERSAMPLING];
lookup[x++] = RINT (sum*(255.0/OVERSAMPLING));
lookup[x++] = RINT (sum*(255.0/OVERSAMPLING));
}
while (x < length)
{
......@@ -389,7 +391,7 @@ gimp_brush_generated_set_radius (GimpBrushGenerated *brush,
if (radius < 0.0)
radius = 0.0;
else if(radius > 32767.0)
else if (radius > 32767.0)
radius = 32767.0;
if (radius == brush->radius)
return radius;
......
......@@ -26,10 +26,10 @@ typedef struct _GimpBrushGenerated
{
GimpBrush gbrush;
gfloat radius;
gfloat hardness; /* 0.0 - 1.0 */
gfloat angle; /* in degrees */
gfloat aspect_ratio; /* y/x */
gfloat radius;
gfloat hardness; /* 0.0 - 1.0 */
gfloat angle; /* in degrees */
gfloat aspect_ratio; /* y/x */
gint freeze;
......@@ -39,7 +39,7 @@ typedef struct _GimpBrushGenerated
typedef struct _GimpBrushGeneratedClass
{
GimpBrushClass parent_class;
void (* generate) (GimpBrushGenerated *brush);
} GimpBrushGeneratedClass;
......
......@@ -35,10 +35,11 @@
#include "paint_core.h"
#include "gimprc.h"
#include "libgimp/gimpintl.h"
#include "libgimp/gimpmath.h"
#include "libgimp/parasiteio.h"
#include "libgimp/gimpintl.h"
static GimpBrushClass *gimp_brush_class;
static GimpBrushPixmapClass *gimp_brush_pixmap_class;
......@@ -80,7 +81,7 @@ void
gimp_brush_pixmap_init (GimpBrushPixmap *brush)
{
brush->pixmap_mask = NULL;
brush->pipe = NULL;
brush->pipe = NULL;
}
GtkType
......@@ -137,10 +138,10 @@ gimp_brush_pixmap_select_brush (PaintCore *paint_core)
angle += G_PI_2;
/* Map it to the [0..2*G_PI) interval */
if (angle < 0)
angle += 2.*G_PI;
else if (angle > 2.*G_PI)
angle -= 2.*G_PI;
ix = RINT (angle / (2.*G_PI) * pipe->rank[i]);
angle += 2.0 * G_PI;
else if (angle > 2.0 * G_PI)
angle -= 2.0 * G_PI;
ix = RINT (angle / (2.0 * G_PI) * pipe->rank[i]);
break;
case PIPE_SELECT_RANDOM:
/* This probably isn't the right way */
......@@ -177,7 +178,7 @@ static gboolean
gimp_brush_pixmap_want_null_motion (PaintCore *paint_core)
{
GimpBrushPipe *pipe;
int i;
gint i;
g_return_val_if_fail (GIMP_IS_BRUSH_PIXMAP (paint_core->brush), TRUE);
......
......@@ -35,10 +35,11 @@
#include "paint_core.h"
#include "gimprc.h"
#include "libgimp/gimpintl.h"
#include "libgimp/gimpmath.h"
#include "libgimp/parasiteio.h"
#include "libgimp/gimpintl.h"
static GimpBrushClass *gimp_brush_class;
static GimpBrushPixmapClass *gimp_brush_pixmap_class;
......@@ -80,7 +81,7 @@ void
gimp_brush_pixmap_init (GimpBrushPixmap *brush)
{
brush->pixmap_mask = NULL;
brush->pipe = NULL;
brush->pipe = NULL;
}
GtkType
......@@ -137,10 +138,10 @@ gimp_brush_pixmap_select_brush (PaintCore *paint_core)
angle += G_PI_2;
/* Map it to the [0..2*G_PI) interval */
if (angle < 0)
angle += 2.*G_PI;
else if (angle > 2.*G_PI)
angle -= 2.*G_PI;