X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=hacks%2Fflow.c;h=607994d0387b1494e8de74aee346fc5906640367;hb=6cee540bdbb571485cd5e519f89f389faebd0495;hp=b5fdfcc4d858361e06967e7ab205c37bcdf50627;hpb=93f25dc6827112d98b8b855ea85c8f5eb8123086;p=xscreensaver diff --git a/hacks/flow.c b/hacks/flow.c index b5fdfcc4..607994d0 100644 --- a/hacks/flow.c +++ b/hacks/flow.c @@ -113,7 +113,7 @@ typedef enum { FLOW_2D = 8, /* Allow 2D attractors */ FLOW_BOX = 16, /* Compute a box around the attractor */ FLOW_SLOW = 32, /* Some bees are slower (and have antifreeze) */ - FLOW_FREEZE = 64, /* Freeze some of the bees in action */ + FLOW_FREEZE = 64 /* Freeze some of the bees in action */ } FlowMode; #define FLOW_DEFAULT (FLOW_ROTATE|FLOW_RIDE|FLOW_ZOOM|FLOW_2D|\ @@ -807,7 +807,8 @@ draw_flow(ModeInfo * mi) double A=0; for(i=0; i<3; i++) A+=C[j][i]*C[j][i]; /* sum squares */ A=sqrt(A); - for(i=0; i<3; i++) C[j][i]/=A; + if (A != 0) /* #### is this right? */ + for(i=0; i<3; i++) C[j][i]/=A; } /* Interpolate between Center and Trained Bee matrices */