From: Ray Strode Date: Wed, 25 Jun 2008 21:48:32 +0000 (-0400) Subject: Change text pulser to use space instead of line drawing characters to prevent X-Git-Tag: 0.4.5~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ba2cd476b9b3d885f912d407c2740ca641b8a1c4;p=thirdparty%2Fplymouth.git Change text pulser to use space instead of line drawing characters to prevent scramblage at font change --- diff --git a/src/libplybootsplash/ply-text-pulser.c b/src/libplybootsplash/ply-text-pulser.c index 3872d608..d11b1dbd 100644 --- a/src/libplybootsplash/ply-text-pulser.c +++ b/src/libplybootsplash/ply-text-pulser.c @@ -53,10 +53,6 @@ #define FRAMES_PER_SECOND 10 #endif -#ifndef INDICATOR_STRING -#define INDICATOR_STRING "██████" -#endif - #define NUMBER_OF_INDICATOR_COLUMNS 6 struct _ply_text_pulser @@ -99,67 +95,25 @@ ply_text_pulser_free (ply_text_pulser_t *pulser) free (pulser); } -static void -draw_frame (ply_text_pulser_t *pulser, - int column, - int row) -{ - int i; - - ply_window_set_text_cursor_position (pulser->window, - column, row); - /* Top of frame - */ - write (STDOUT_FILENO, "┌", strlen ("┌")); - for (i = 0; i < pulser->number_of_columns - 2; i++) - write (STDOUT_FILENO, "─", strlen ("─")); - write (STDOUT_FILENO, "┐", strlen ("┐")); - - ply_window_set_text_cursor_position (pulser->window, - column, row + 1); - /* Middle - */ - write (STDOUT_FILENO, "│", strlen ("│")); - - ply_window_set_text_cursor_position (pulser->window, - column + pulser->number_of_columns - 1, - row + 1); - write (STDOUT_FILENO, "│", strlen ("│")); - - ply_window_set_text_cursor_position (pulser->window, - column, row + 2); - /* Bottom of frame - */ - write (STDOUT_FILENO, "└", strlen ("└")); - - for (i = 0; i < pulser->number_of_columns - 2; i++) - write (STDOUT_FILENO, "─", strlen ("─")); - write (STDOUT_FILENO, "┘", strlen ("┘")); -} - -static void -draw_indicator (ply_text_pulser_t *pulser) -{ - write (STDOUT_FILENO, INDICATOR_STRING, strlen (INDICATOR_STRING)); -} - static void animate_at_time (ply_text_pulser_t *pulser, double time) { ply_window_set_mode (pulser->window, PLY_WINDOW_MODE_TEXT); - draw_frame (pulser, pulser->column, pulser->row); - ply_window_set_text_cursor_position (pulser->window, pulser->column + pulser->spinner_position, pulser->row + 1); + ply_window_set_background_color (pulser->window, PLY_WINDOW_COLOR_DEFAULT); write (STDOUT_FILENO, " ", strlen (" ")); pulser->spinner_position = ((pulser->number_of_columns - 2) - NUMBER_OF_INDICATOR_COLUMNS - 1) * (.5 * sin (time) + .5) + 2; ply_window_set_text_cursor_position (pulser->window, pulser->column + pulser->spinner_position, pulser->row + 1); - draw_indicator (pulser); + + ply_window_set_background_color (pulser->window, PLY_WINDOW_COLOR_WHITE); + write (STDOUT_FILENO, " ", strlen (" ")); + ply_window_set_background_color (pulser->window, PLY_WINDOW_COLOR_DEFAULT); } static void