From 60655d8e7ad28aa7d9522c08d56e901ac2241187 Mon Sep 17 00:00:00 2001 From: William Skaggs Date: Thu, 9 Dec 2004 21:34:48 +0000 Subject: [PATCH] Bill Skaggs * 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). --- ChangeLog | 6 ++++++ app/core/gimpbrushpipe-load.c | 8 +------- app/core/gimpbrushpipe.c | 8 +------- 3 files changed, 8 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index d322c405de..f38bb852a3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2004-12-09 Bill Skaggs + + * 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 * plug-ins/common/cartoon.c: marked the menu entry for translation diff --git a/app/core/gimpbrushpipe-load.c b/app/core/gimpbrushpipe-load.c index 6f1eefd097..e628128068 100644 --- a/app/core/gimpbrushpipe-load.c +++ b/app/core/gimpbrushpipe-load.c @@ -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); } diff --git a/app/core/gimpbrushpipe.c b/app/core/gimpbrushpipe.c index 6f1eefd097..e628128068 100644 --- a/app/core/gimpbrushpipe.c +++ b/app/core/gimpbrushpipe.c @@ -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); }