File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -866,8 +866,10 @@ class Sketch
866
866
if (m_has_last) {
867
867
// We want the "cursor" along the sine wave to move at a
868
868
// random rate.
869
- m_p += pow (m_randomness, drand48 () * 2.0 - 1.0 );
870
- double r = sin (m_p / (m_length / (M_PI * 2.0 ))) * m_scale;
869
+ float _drand48 = rand () / float (RAND_MAX);
870
+ float _M_PI = 3.14159265358979323846 ;
871
+ m_p += pow (m_randomness, _drand48 * 2.0 - 1.0 );
872
+ double r = sin (m_p / (m_length / (_M_PI * 2.0 ))) * m_scale;
871
873
double den = m_last_x - *x;
872
874
double num = m_last_y - *y;
873
875
double len = num*num + den*den;
@@ -891,8 +893,7 @@ class Sketch
891
893
inline void
892
894
rewind (unsigned path_id)
893
895
{
894
- unsigned short seed[] = {0 , 0 , 0 };
895
- seed48 (seed);
896
+ srand (0 );
896
897
m_has_last = false ;
897
898
m_p = 0.0 ;
898
899
if (m_scale != 0.0 ) {
You can’t perform that action at this time.
0 commit comments