diff --git a/include/gintctl/util.h b/include/gintctl/util.h index a4e80c2..0734eb1 100644 --- a/include/gintctl/util.h +++ b/include/gintctl/util.h @@ -45,6 +45,10 @@ void scrollbar(int offset, int length, int top, int bottom); /* row_count(): Number of rows available to row_print() */ int row_count(void); +/* row_x() row_y(): Coordinates for row_print() */ +int row_x(int x); +int row_y(int y); + //--- // General (x,y) printing //--- diff --git a/src/util.c b/src/util.c index 4e61b09..40e5248 100644 --- a/src/util.c +++ b/src/util.c @@ -125,6 +125,15 @@ int row_count(void) return ROW_COUNT; } +int row_x(int x) +{ + return ROW_X + ROW_W * (x - 1); +} +int row_y(int y) +{ + return ROW_Y + ROW_H * (y - 1) + ROW_YPAD; +} + //--- // Other drawing utilities //---