X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?p=xscreensaver;a=blobdiff_plain;f=hacks%2Fepicycle.c;h=89fab0b26f073c645adef703aeb55cad75e9b553;hp=91a47a28ee93489cca060e3f2dce3795595cf5e3;hb=39809ded547bdbb08207d3e514950425215b4410;hpb=4361b69d3178d7fc98d0388f9a223af6c2651aba 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; + } }