diff options
Diffstat (limited to 'apps/plugins/reversi')
-rw-r--r-- | apps/plugins/reversi/reversi-gui.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/apps/plugins/reversi/reversi-gui.c b/apps/plugins/reversi/reversi-gui.c index fa20e46bb6..c4c7506f2a 100644 --- a/apps/plugins/reversi/reversi-gui.c +++ b/apps/plugins/reversi/reversi-gui.c | |||
@@ -49,6 +49,9 @@ further options: | |||
49 | 49 | ||
50 | PLUGIN_HEADER | 50 | PLUGIN_HEADER |
51 | 51 | ||
52 | int font_width=4; | ||
53 | int font_height=8; | ||
54 | |||
52 | /* Where the board begins */ | 55 | /* Where the board begins */ |
53 | #define XOFS 4 | 56 | #define XOFS 4 |
54 | #define YOFS 4 | 57 | #define YOFS 4 |
@@ -59,7 +62,7 @@ PLUGIN_HEADER | |||
59 | #define MARGIN_C_W 0 | 62 | #define MARGIN_C_W 0 |
60 | #define MARGIN_C_H 2 | 63 | #define MARGIN_C_H 2 |
61 | #else | 64 | #else |
62 | #define MARGIN_W (XOFS*2 + 16) | 65 | #define MARGIN_W (XOFS*2 + font_width*2) |
63 | #define MARGIN_H (YOFS*2+1) | 66 | #define MARGIN_H (YOFS*2+1) |
64 | #define MARGIN_C_W 1 | 67 | #define MARGIN_C_W 1 |
65 | #define MARGIN_C_H 0 | 68 | #define MARGIN_C_H 0 |
@@ -112,7 +115,7 @@ PLUGIN_HEADER | |||
112 | #define LEGEND_Y(lr) (CELL_Y(BOARD_SIZE+lr) + YOFS + 1) | 115 | #define LEGEND_Y(lr) (CELL_Y(BOARD_SIZE+lr) + YOFS + 1) |
113 | #else | 116 | #else |
114 | #define LEGEND_X(lc) (CELL_X(BOARD_SIZE+lc) + XOFS + 1) | 117 | #define LEGEND_X(lc) (CELL_X(BOARD_SIZE+lc) + XOFS + 1) |
115 | #define LEGEND_Y(lr) (CELL_Y(lr)) | 118 | #define LEGEND_Y(lr) (CELL_Y(lr) > font_height*2 ? CELL_Y(lr) : font_height*(lr) + XOFS) |
116 | #endif | 119 | #endif |
117 | 120 | ||
118 | 121 | ||
@@ -572,6 +575,9 @@ enum plugin_status plugin_start(const void *parameter) { | |||
572 | int w_cnt, b_cnt; | 575 | int w_cnt, b_cnt; |
573 | char msg_buf[30]; | 576 | char msg_buf[30]; |
574 | 577 | ||
578 | /* Initialize Font Width and height */ | ||
579 | rb->lcd_getstringsize("x", &font_width, &font_height); | ||
580 | |||
575 | #ifdef HAVE_TOUCHSCREEN | 581 | #ifdef HAVE_TOUCHSCREEN |
576 | rb->touchscreen_set_mode(TOUCHSCREEN_POINT); | 582 | rb->touchscreen_set_mode(TOUCHSCREEN_POINT); |
577 | #endif | 583 | #endif |