5353#define T_LLCR ACS_LLCORNER
5454#endif
5555
56+ // Window size
57+ #define WIDTH_MIN 68
58+ #define WIDTH_MARGIN 4
59+ #define HEIGHT_MIN 5
60+ #define HEIGHT_MARGIN 4
61+
5662// Define standard curses color constants for better readability
5763#define C_BLACK 0
5864#define C_RED 1
@@ -91,7 +97,7 @@ static double softmax = 0.0, hardmax = FLT_MAX, softmin = 0.0, hardmin = -FLT_MA
9197static char title [256 ] = ".: ttyplot :." , unit [64 ] = {0 }, ls [256 ] = {0 };
9298static double values1 [1024 ] = {0 }, values2 [1024 ] = {0 };
9399static int width = 0 , height = 0 , n = -1 , v = 0 , c = 0 , rate = 0 , two = 0 ,
94- plotwidth = 0 , plotheight = 0 ;
100+ plotwidth = WIDTH_MIN - WIDTH_MARGIN , plotheight = 0 ;
95101static bool fake_clock = false;
96102static char * errstr = NULL ;
97103static bool redraw_needed = false;
@@ -485,7 +491,7 @@ static void show_all_centered(const char *message) {
485491}
486492
487493static int window_big_enough_to_draw (void ) {
488- return (width >= 68 ) && (height >= 5 );
494+ return (width >= WIDTH_MIN ) && (height >= HEIGHT_MIN );
489495}
490496
491497static void show_window_size_error (void ) {
@@ -500,8 +506,8 @@ static void paint_plot(void) {
500506 erase ();
501507 getmaxyx (stdscr , height , width );
502508
503- plotheight = height - 4 ;
504- plotwidth = width - 4 ;
509+ plotheight = height - HEIGHT_MARGIN ;
510+ plotwidth = width - WIDTH_MARGIN ;
505511 if (plotwidth >= (int )((sizeof (values1 ) / sizeof (double )) - 1 ))
506512 exit (0 );
507513
0 commit comments