чување 1bc19f86ebd14ba5d144b2a32e87b87cbf609b82
родитељ 41a84a2eb048a0098057a9f1c3fbcd6a7f7313ed
Аутор: Страхиња Радић <contact@strahinja.org>
Датум: Thu, 24 Feb 2022 08:15:52 +0100
Fix dialog drawing
Signed-off-by: Страхиња Радић <contact@strahinja.org>
Diffstat:
измењених датотека: 2, додавања: 4(+), брисања: 4(-)
diff --git a/draw.c b/draw.c
@@ -562,10 +562,10 @@ draw_help(const struct DrawState* state)
int maxy = state->maxy;
startx = w > maxx ? 0 : (maxx - w) / 2;
- endx = w > maxx ? maxx - 1 : maxx - startx;
+ endx = w > maxx ? maxx - 1 : startx + w;
starty = h > maxy - 1 ? 0 : (maxy - h) / 2;
- endy = h > maxy - 1 ? maxy - 2 : maxy - starty;
+ endy = h > maxy - 1 ? maxy - 2 : starty + h;
draw_box(startx, endx, starty, endy, DLG_FG, DLG_BG);
if (!draw_string(startx, starty, TITLE_FG, TITLE_BG, help_title,
@@ -595,7 +595,7 @@ draw_input_dialog(const struct DrawState* state)
size_t dlen = 0;
startx = w > maxx ? 0 : (maxx - w) / 2;
- endx = w > maxx ? maxx - 1 : maxx - startx;
+ endx = w > maxx ? maxx - 1 : startx + w;
starty = maxy - 1 - h;
endy = maxy - 1;
diff --git a/draw.h b/draw.h
@@ -15,7 +15,7 @@
#define BORDER_HOR ((uint32_t)L'\u2500')
#define HELP_WIDTH 60
-#define HELP_HEIGHT 21
+#define HELP_HEIGHT 22
#define INPUT_DLG_WIDTH 20
#define INPUT_DLG_HEIGHT 4
#define TAB_SIZE 8