diff --git a/CHANGELOG.md b/CHANGELOG.md index 8d321f1..84e1c29 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +### v4.0.8 +* Add new Cursor::move overload to accept two integers + ### v4.0.7 * Added unit testing in `tests/` directory * Added zig build option diff --git a/rawterm/cursor.cpp b/rawterm/cursor.cpp index 42c0667..4f057e2 100644 --- a/rawterm/cursor.cpp +++ b/rawterm/cursor.cpp @@ -25,6 +25,10 @@ namespace rawterm { << std::to_string(pos.horizontal) << 'H' << std::flush; } + void Cursor::move(const int vertical, const int horizontal) { + move({vertical, horizontal}); + } + void Cursor::move_up(int in) { vertical -= in; diff --git a/rawterm/cursor.h b/rawterm/cursor.h index f06c127..6b8df57 100644 --- a/rawterm/cursor.h +++ b/rawterm/cursor.h @@ -11,6 +11,7 @@ namespace rawterm { Cursor(Pos p) : Pos {p} {} void reset() const; void move(const Pos&); + void move(const int, const int); void move_up(int = 1); void move_down(int = 1); void move_right(int = 1);