util: add functions for row positioning

This commit is contained in:
Lephe 2020-10-13 21:33:20 +02:00
parent ff15ac0d56
commit 9d6ff94790
Signed by: Lephenixnoir
GPG Key ID: 1BBA026E13FC0495
2 changed files with 13 additions and 0 deletions

View File

@ -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
//---

View File

@ -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
//---