diff --git a/USAGE.md b/USAGE.md index 95e11df42..dafcf6680 100644 --- a/USAGE.md +++ b/USAGE.md @@ -914,7 +914,7 @@ ncplane_resize_simple(struct ncplane* n, int ylen, int xlen){ // Move this plane relative to the standard plane, or the plane to which it is // bound (if it is bound to a plane). It is an error to attempt to move the -// standard plane. +// standard plane. Specifying a coordinate as -1 will hold it constant. int ncplane_move_yx(struct ncplane* n, int y, int x); // Get the origin of plane 'n' relative to its bound plane, or its pile (if diff --git a/doc/man/man3/notcurses_plane.3.md b/doc/man/man3/notcurses_plane.3.md index 1291a885b..265450c31 100644 --- a/doc/man/man3/notcurses_plane.3.md +++ b/doc/man/man3/notcurses_plane.3.md @@ -277,6 +277,12 @@ to multiple ncplanes. So long as all threads are readers, multiple threads may work with a single ncplane. A reading function is any which accepts a **const struct ncplane**. +A plane has a virtual cursor; move it with **ncplane_cursor_move_yx**. +Specifying -1 as one or both coordinates will hold that axis constant. Unless +coordinates are specified for a call, action takes place at the plane's +virtual cursor, which automatically moves along with output. The current +virtual cursor location can be acquired with **ncplane_cursor_yx**. + **ncplane_yx** returns the coordinates of the specified plane's origin, relative to the plane to which it is bound. Either or both of ***y*** and ***x*** may be **NULL**. **ncplane_y** and **ncplane_x** allow a single component of this @@ -423,6 +429,9 @@ each representing a single RGBA pixel, or **NULL** on failure. **ncplane_erase_region** returns -1 if any of its parameters are negative, or if they specify any area beyond the plane. +**ncplane_cursor_move_yx** returns -1 if the coordinates are beyond the +dimensions of the specified plane (except for the special value -1). + Functions returning **int** return 0 on success, and non-zero on error. All other functions cannot fail (and return **void**). diff --git a/include/notcurses/notcurses.h b/include/notcurses/notcurses.h index 7b9154bd2..ed7c21bd1 100644 --- a/include/notcurses/notcurses.h +++ b/include/notcurses/notcurses.h @@ -1492,7 +1492,7 @@ API int ncplane_base(struct ncplane* n, nccell* c); // Move this plane relative to the standard plane, or the plane to which it is // bound (if it is bound to a plane). It is an error to attempt to move the -// standard plane. +// standard plane. Specifying a coordinate as -1 will hold it constant. API int ncplane_move_yx(struct ncplane* n, int y, int x); // Get the origin of plane 'n' relative to its bound plane, or pile (if 'n' is