X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?p=xscreensaver;a=blobdiff_plain;f=hacks%2Fglx%2Fsonar.c;h=cdafdef5d0f4dd349047fcf7fae5a79c1993d257;hp=535b52fea5599ea0d014ada3804e7638a2b7a5d1;hb=f0261d8acab611f3433160e4f07367b870439739;hpb=7b34ef992563d7bcbb64cc5597dc45fa24470b05 diff --git a/hacks/glx/sonar.c b/hacks/glx/sonar.c index 535b52fe..cdafdef5 100644 --- a/hacks/glx/sonar.c +++ b/hacks/glx/sonar.c @@ -236,6 +236,9 @@ draw_screen (ModeInfo *mi, Bool mesh_p, Bool sweep_p) r0 = i / (GLfloat) r_steps; r1 = (i+1) / (GLfloat) r_steps; + + if (r1 > 1) r1 = 1; /* avoid asin lossage */ + z0 = cos (curvature/2 * asin (r0)) / 2 - zoff; z1 = cos (curvature/2 * asin (r1)) / 2 - zoff;