From: Timo Korvola Date: Fri, 9 Mar 2018 21:38:16 +0000 (+0200) Subject: Update font_height & _width whenever they are used. X-Git-Url: https://scope-eye.net/git/?a=commitdiff_plain;h=082ca43f5576cf628da1ab78043e0d5948d55460;p=liskon_frotz.git Update font_height & _width whenever they are used. Call os_data(0, &font_height, &font_width) to update. On those front ends where it does nothing (curses) it does not matter. --- diff --git a/src/common/screen.c b/src/common/screen.c index 0b2b250..313b415 100644 --- a/src/common/screen.c +++ b/src/common/screen.c @@ -39,6 +39,7 @@ static struct { { UNKNOWN, 0, 0, 0 } }; +/* These are usually out of date. Always update before using. */ static int font_height = 1; static int font_width = 1; @@ -225,6 +226,7 @@ void screen_new_line (void) cwp->x_cursor = cwp->left + 1; + os_font_data(0, &font_height, &font_width); if (cwp->y_cursor + 2 * font_height - 1 > cwp->y_size) if (enable_scrolling) { @@ -402,6 +404,7 @@ void screen_erase_input (const zchar *buf) y = cwp->y_pos + cwp->y_cursor - 1; x = cwp->x_pos + cwp->x_cursor - 1; + os_font_data(0, &font_height, &font_width); os_erase_area (y, x, y + font_height - 1, x + width - 1, -1); os_set_cursor (y, x); @@ -995,6 +998,7 @@ void z_erase_line (void) y = cwp->y_pos + cwp->y_cursor - 1; x = cwp->x_pos + cwp->x_cursor - 1; + os_font_data(0, &font_height, &font_width); os_erase_area (y, x, y + font_height - 1, x + pixels - 1, -1); }/* z_erase_line */ @@ -1223,7 +1227,7 @@ void z_print_table (void) if (i != 0) { flush_buffer (); - + os_font_data(0, &font_height, &font_width); cwp->y_cursor += font_height; cwp->x_cursor = x;