Bill Skaggs <weskaggs@primate.ucdavis.edu>

* app/core/gimpbrushpipe.c (gimp_brush_pipe_select_brush):
	Don't initialize a new random number generator every time a brush
	is selected from a pipe.  Fixes bug #148205).
This commit is contained in:
William Skaggs 2004-12-09 21:34:48 +00:00
parent 1e77f9d4a7
commit 60655d8e7a
3 changed files with 8 additions and 14 deletions

View File

@ -1,3 +1,9 @@
2004-12-09 Bill Skaggs <weskaggs@primate.ucdavis.edu>
* app/core/gimpbrushpipe.c (gimp_brush_pipe_select_brush):
Don't initialize a new random number generator every time a brush
is selected from a pipe. Fixes bug #148205).
2004-12-09 DindinX <dindinx@gimp.org>
* plug-ins/common/cartoon.c: marked the menu entry for translation

View File

@ -232,14 +232,10 @@ gimp_brush_pipe_select_brush (GimpBrush *brush,
GimpBrushPipe *pipe = GIMP_BRUSH_PIPE (brush);
gint i, brushix, ix;
gdouble angle;
GRand *gr;
if (pipe->nbrushes == 1)
return GIMP_BRUSH (pipe->current);
/* Initialise random number generator */
gr = g_rand_new ();
brushix = 0;
for (i = 0; i < pipe->dimension; i++)
{
@ -264,7 +260,7 @@ gimp_brush_pipe_select_brush (GimpBrush *brush,
case PIPE_SELECT_RANDOM:
/* This probably isn't the right way */
ix = g_rand_int_range (gr, 0, pipe->rank[i]);
ix = g_random_int_range (0, pipe->rank[i]);
break;
case PIPE_SELECT_PRESSURE:
@ -294,8 +290,6 @@ gimp_brush_pipe_select_brush (GimpBrush *brush,
pipe->current = pipe->brushes[brushix];
g_rand_free (gr);
return GIMP_BRUSH (pipe->current);
}

View File

@ -232,14 +232,10 @@ gimp_brush_pipe_select_brush (GimpBrush *brush,
GimpBrushPipe *pipe = GIMP_BRUSH_PIPE (brush);
gint i, brushix, ix;
gdouble angle;
GRand *gr;
if (pipe->nbrushes == 1)
return GIMP_BRUSH (pipe->current);
/* Initialise random number generator */
gr = g_rand_new ();
brushix = 0;
for (i = 0; i < pipe->dimension; i++)
{
@ -264,7 +260,7 @@ gimp_brush_pipe_select_brush (GimpBrush *brush,
case PIPE_SELECT_RANDOM:
/* This probably isn't the right way */
ix = g_rand_int_range (gr, 0, pipe->rank[i]);
ix = g_random_int_range (0, pipe->rank[i]);
break;
case PIPE_SELECT_PRESSURE:
@ -294,8 +290,6 @@ gimp_brush_pipe_select_brush (GimpBrush *brush,
pipe->current = pipe->brushes[brushix];
g_rand_free (gr);
return GIMP_BRUSH (pipe->current);
}