From d6db7301f0a384016a618394bfe91b3f6d94f15d Mon Sep 17 00:00:00 2001 From: Shylie Date: Thu, 7 Mar 2024 11:47:41 -0500 Subject: [PATCH] Remove new_width and new_height parameters from resize callback. Use terml_get_width() and terml_get_height() instead. --- include/terml.h | 4 +--- source/terml.cpp | 6 +++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/include/terml.h b/include/terml.h index 4f74252..2480b28 100644 --- a/include/terml.h +++ b/include/terml.h @@ -11,9 +11,7 @@ typedef int (*terml_quit_callback) (); typedef void (*terml_key_callback) (char code); typedef void (*terml_resize_callback)( unsigned int previous_width, - unsigned int previous_height, - unsigned int new_width, - unsigned int new_height + unsigned int previous_height ); int terml_init(); diff --git a/source/terml.cpp b/source/terml.cpp index a6cfcec..8761ea3 100644 --- a/source/terml.cpp +++ b/source/terml.cpp @@ -214,8 +214,8 @@ void terml::setup_buffer() stdin_buffer[STDIN_BUFFER_SIZE] = '\0'; - unsigned int new_width = width; - unsigned int new_height = height; + const unsigned int new_width = width; + const unsigned int new_height = height; const int scanned = sscanf(stdin_buffer, CURSOR_POSITION_FORMAT(), &new_height, &new_width); if (scanned != 2) { @@ -244,7 +244,7 @@ void terml::setup_buffer() if (resize) { - resize(old_width, old_height, new_width, new_height); + resize(old_width, old_height); } } }