Remove hardcoded font size.

Change-Id: I5fbd54467ec727bb3f93ecb75e03593d466e9b7b
This commit is contained in:
Felix Raimundo
2016-03-23 19:05:56 +01:00
parent fd95a7e558
commit cb2bcb6ad9

View File

@@ -17,14 +17,12 @@ static void clear_prompt() {
}
static void print_prompt(char* text, int index) {
// Here we draw the input and inverse the pixels under the cursor.
// FIXME: hard coded value
char* tmp = (char*) " ";
KDSize font_size = KDStringSize(tmp);
KDDrawLine(KDPointMake(0, SCREEN_HEIGHT - PROMPT_HEIGHT),
KDPointMake(SCREEN_WIDTH, SCREEN_HEIGHT - PROMPT_HEIGHT), 0xff);
KDPointMake(SCREEN_WIDTH, SCREEN_HEIGHT - PROMPT_HEIGHT), 0xff);
KDDrawString(text, KDPointMake(0, SCREEN_HEIGHT - (PROMPT_HEIGHT / 2)));
// The hardcoded 7 is the width of the font.
KDDrawInverseChar(text[index],
KDPointMake(index*7, SCREEN_HEIGHT - (PROMPT_HEIGHT / 2)));
KDDrawInverseChar(text[index], KDPointMake(index * font_size.width, SCREEN_HEIGHT - (PROMPT_HEIGHT / 2)));
}
char* get_text() {