From 9b9bfb69d431ae9f88ec06f778a6c5475da970a6 Mon Sep 17 00:00:00 2001 From: Ttibsi Date: Fri, 20 Sep 2024 22:20:30 +0100 Subject: [PATCH] Allow internal position of cursor to change even in testing mode --- rawterm/cursor.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/rawterm/cursor.cpp b/rawterm/cursor.cpp index 8fb96d7..2fa2706 100644 --- a/rawterm/cursor.cpp +++ b/rawterm/cursor.cpp @@ -26,38 +26,38 @@ namespace rawterm { } void Cursor::move_up(int in) { + vertical--; + if (detail::is_debug()) { return; } - - vertical--; std::cout << "\x1b[" + std::to_string(in) + "A" << std::flush; } void Cursor::move_down(int in) { + vertical++; + if (detail::is_debug()) { return; } - - vertical++; std::cout << "\x1b[" + std::to_string(in) + "B" << std::flush; } void Cursor::move_right(int in) { + horizontal++; + if (detail::is_debug()) { return; } - - horizontal++; std::cout << "\x1b[" + std::to_string(in) + "C" << std::flush; } void Cursor::move_left(int in) { + horizontal--; + if (detail::is_debug()) { return; } - - horizontal--; std::cout << "\x1b[" + std::to_string(in) + "D" << std::flush; }