X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=hacks%2Fepicycle.c;h=89fab0b26f073c645adef703aeb55cad75e9b553;hb=39809ded547bdbb08207d3e514950425215b4410;hp=91a47a28ee93489cca060e3f2dce3795595cf5e3;hpb=aa75c7476aeaa84cf3abc192b376a8b03c325213;p=xscreensaver diff --git a/hacks/epicycle.c b/hacks/epicycle.c index 91a47a28..89fab0b2 100644 --- a/hacks/epicycle.c +++ b/hacks/epicycle.c @@ -618,6 +618,17 @@ static void rescale_circles(struct state *st, Body *pb, { printf("enlarge by x%.2f skipped...\n", scale); } + + if (st->width > st->height * 5 || /* window has weird aspect */ + st->height > st->width * 5) + { + Circle *p; + double r = (st->width > st->height + ? st->width / (double) st->height + : st->height / (double) st->width); + for (p=pb->epicycles; p; p=p->pchild) + p->radius *= r; + } }