X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?p=xscreensaver;a=blobdiff_plain;f=hacks%2Fglx%2Fgears.c;h=054bc1c0a7b972d224b02ea8dc4dda64de33e1ed;hp=added7c65b840fb4fc806e38873ef7307c68dff9;hb=6b1c86cf395f59389e4ece4ea8f4bea2c332745b;hpb=488f2fa8fbdbc77e91a70da2962d73af49e6cace diff --git a/hacks/glx/gears.c b/hacks/glx/gears.c index added7c6..054bc1c0 100644 --- a/hacks/glx/gears.c +++ b/hacks/glx/gears.c @@ -1,4 +1,4 @@ -/* gears, Copyright (c) 2007 Jamie Zawinski +/* gears, Copyright (c) 2007-2008 Jamie Zawinski * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -124,7 +124,9 @@ gears_handle_event (ModeInfo *mi, XEvent *event) } else if (event->xany.type == ButtonPress && (event->xbutton.button == Button4 || - event->xbutton.button == Button5)) + event->xbutton.button == Button5 || + event->xbutton.button == Button6 || + event->xbutton.button == Button7)) { gltrackball_mousewheel (bp->trackball, event->xbutton.button, 10, !!event->xbutton.state); @@ -690,16 +692,20 @@ planetary_gears (ModeInfo *mi) g4->y = 0; g4->th = -g3->th; + /* rotate central gear 1/2 tooth-size if odd number of teeth */ + if (g4->nteeth & 1) + g4->th -= (180.0 / g4->nteeth); + g0->inverted_p = True; g0->x = 0; g0->y = 0; - g0->nteeth = g4->nteeth * 3; - g0->r = g4->r * 3.05; + g0->nteeth = g1->nteeth * 3; + g0->r = g1->r * 3.05; g0->inner_r = g0->r * 0.8; g0->inner_r2 = 0; g0->inner_r3 = 0; - g0->th = -(g4->th - (180 / g0->nteeth)); - g0->ratio = g4->ratio / 3; + g0->th = g1->th + (180 / g0->nteeth); + g0->ratio = g1->ratio / 3; g0->tooth_slope = 0; g0->nubs = 3;