]> granicus.if.org Git - imagemagick/commitdiff
Spread random offset is centered about 0
authorCristy <urban-warrior@imagemagick.org>
Mon, 10 Aug 2015 10:29:20 +0000 (06:29 -0400)
committerCristy <urban-warrior@imagemagick.org>
Mon, 10 Aug 2015 10:29:20 +0000 (06:29 -0400)
MagickCore/effect.c

index 8ce4a627222c1648eb3f05fc4198913a2c293fcb..0db62ab0734039462ce27a214aadfaaf818430da 100644 (file)
@@ -3504,9 +3504,9 @@ MagickExport Image *SpreadImage(const Image *image,const double radius,
       for ( ; ; )
       {
         x_offset=(ssize_t) floor((double) x+width*
-          GetPseudoRandomValue(random_info));
+          (GetPseudoRandomValue(random_info)-0.5));
         y_offset=(ssize_t) floor((double) y+width*
-          GetPseudoRandomValue(random_info));
+          (GetPseudoRandomValue(random_info)-0.5));
         if ((x_offset >= 0) && (x_offset < image->columns) &&
             (y_offset >= 0) && (y_offset < image->rows))
           break;