X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?p=xscreensaver;a=blobdiff_plain;f=hacks%2Fglx%2Fcarousel.c;fp=hacks%2Fglx%2Fcarousel.c;h=23e0ef3a7a423fe462cb7fe450efbb3b74360fc0;hp=011df41a077657b9b5c8b3c27e560fde8cefd228;hb=d1ae2829ff0fd2a96c16a0c8c5420efaa47d7b30;hpb=7edd66e6bd3209013ee059819747b10b5835635b diff --git a/hacks/glx/carousel.c b/hacks/glx/carousel.c index 011df41a..23e0ef3a 100644 --- a/hacks/glx/carousel.c +++ b/hacks/glx/carousel.c @@ -1,4 +1,4 @@ -/* carousel, Copyright (c) 2005-2014 Jamie Zawinski +/* carousel, Copyright (c) 2005-2015 Jamie Zawinski * Loads a sequence of images and rotates them around. * * Permission to use, copy, modify, distribute, and sell this software and its @@ -494,8 +494,14 @@ loading_msg (ModeInfo *mi, int n) sprintf (text, "Loading images... (%d%%)", (int) (n * 100 / MI_COUNT(mi))); - if (ss->loading_sw == 0) /* only do this once, so that the string doesn't move. */ - ss->loading_sw = texture_string_width (ss->texfont, text, &ss->loading_sh); + if (ss->loading_sw == 0) + { + /* only do this once, so that the string doesn't move. */ + XCharStruct e; + texture_string_metrics (ss->texfont, text, &e, 0, 0); + ss->loading_sw = e.width; + ss->loading_sh = e.ascent + e.descent; + } glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); @@ -773,10 +779,13 @@ draw_frame (ModeInfo *mi, image_frame *frame, time_t now, Bool body_p) } else /* Draw a title under the image. */ { + XCharStruct e; int sw, sh; GLfloat scale = 0.05; char *title = frame->current.title ? frame->current.title : "(untitled)"; - sw = texture_string_width (ss->texfont, title, &sh); + texture_string_metrics (ss->texfont, title, &e, 0, 0); + sw = e.width; + sh = e.ascent + e.descent; glTranslatef (0, -scale, 0);