X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?p=xscreensaver;a=blobdiff_plain;f=hacks%2Fglx%2Fmolecule.c;fp=hacks%2Fglx%2Fmolecule.c;h=d8bc1d854ccf6ab42ae201a134f8194eb01a2d67;hp=57827b2b3d2e6fdbbbf30e374454653218ed5639;hb=39809ded547bdbb08207d3e514950425215b4410;hpb=4361b69d3178d7fc98d0388f9a223af6c2651aba diff --git a/hacks/glx/molecule.c b/hacks/glx/molecule.c index 57827b2b..d8bc1d85 100644 --- a/hacks/glx/molecule.c +++ b/hacks/glx/molecule.c @@ -33,7 +33,7 @@ "*wireframeThreshold: 150 \n" \ "*suppressRotationAnimation: True\n" \ -# define refresh_molecule 0 +# define free_molecule 0 # define release_molecule 0 #undef countof #define countof(x) (sizeof((x))/sizeof((*x))) @@ -1187,8 +1187,15 @@ ENTRYPOINT void reshape_molecule (ModeInfo *mi, int width, int height) { GLfloat h = (GLfloat) height / (GLfloat) width; + int y = 0; - glViewport (0, 0, (GLint) width, (GLint) height); + if (width > height * 5) { /* tiny window: show middle */ + height = width * 9/16; + y = -height/2; + h = height / (GLfloat) width; + } + + glViewport (0, y, (GLint) width, (GLint) height); glMatrixMode(GL_PROJECTION); glLoadIdentity(); @@ -1288,7 +1295,7 @@ init_molecule (ModeInfo *mi) molecule_configuration *mc; int wire; - MI_INIT (mi, mcs, NULL); + MI_INIT (mi, mcs); mc = &mcs[MI_SCREEN(mi)];