Tput::Coordinates
Inherits Crystallabs::Helpers::Logging
Collection of methods related to coordinates within the terminal screen.
Constants
Log = ::Log.for((self.name.gsub("::", '.')).underscore)
Instance methods
_adjust_xy_abs(x = 0, y = 0)
Returns [x,y] adjusted so that the values are within screen bounds.
_adjust_xy_rel(x = 0, y = 0)
Returns [x,y] adjusted so that when added to the cursor's current position, the values are within screen bounds.
_ncoords
Makes sure that the cursor position is within screen size by adjusting it if/when necessary.
The usual way to use this function is to set cursor position without any particular
considerations for the boundaries, and then call _ncoords to make sure the cursor
is brought back into the screen if it was out of it.
reset_screen_size
Gets terminal/screen size and resets the values in memory to the discovered dimensions.