-/* geodesicgears, Copyright (c) 2014 Jamie Zawinski <jwz@jwz.org>
+/* geodesicgears, Copyright (c) 2014-2015 Jamie Zawinski <jwz@jwz.org>
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
"*wireframe: False \n" \
"*showFPS: False \n" \
"*texFontCacheSize: 100 \n" \
+ "*suppressRotationAnimation: True\n" \
"*font: -*-helvetica-medium-r-normal-*-*-160-*-*-*-*-*-*\n" \
# define refresh_geodesic 0
0.0, 0.0, 0.0,
0.0, 1.0, 0.0);
+# ifdef HAVE_MOBILE /* Keep it the same relative size when rotated. */
+ {
+ int o = (int) current_device_rotation();
+ if (o != 0 && o != 180 && o != -180)
+ glScalef (1/h, 1/h, 1/h);
+ }
+# endif
+
glClear(GL_COLOR_BUFFER_BIT);
}
int w, h, j;
char buf[100];
+ XCharStruct e;
/* If an even number of teeth, offset by 1/2 tooth width. */
if (s->direction > 0 /* && !(g->nteeth & 1) */)
glPushMatrix();
glScalef(0.005, 0.005, 0.005);
sprintf (buf, "%d", i);
- w = texture_string_width (bp->font, buf, &h);
- glTranslatef (-w/2, -h*2/3, 0);
+ texture_string_metrics (bp->font, buf, &e, 0, 0);
+ w = e.width;
+ h = e.ascent + e.descent;
+ glTranslatef (-w/2, -h/2, 0);
print_texture_string (bp->font, buf);
glPopMatrix();
glTranslatef (r * cos(th), r * sin(th), -g->z + 0.01);
glScalef(ss, ss, ss);
sprintf (buf, "%d", j + 1);
- w = texture_string_width (bp->font, buf, &h);
- glTranslatef (-w/2, -h*2/3, 0);
+ texture_string_metrics (bp->font, buf, &e, 0, 0);
+ w = e.width;
+ h = e.ascent + e.descent;
+ glTranslatef (-w/2, -h/2, 0);
print_texture_string (bp->font, buf);
glPopMatrix();
}