Skip to content

Commit

Permalink
Merge pull request #9 from stone-payments/168449-final-changes
Browse files Browse the repository at this point in the history
168449-final-changes
  • Loading branch information
andrenepomuceno authored Jul 23, 2020
2 parents 3360fa4 + 3f03824 commit 8dc7d8e
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
25 changes: 25 additions & 0 deletions ugui.c
Original file line number Diff line number Diff line change
Expand Up @@ -4099,3 +4099,28 @@ _UG_ImageUpdate(UG_WINDOW* wnd, UG_OBJECT* obj)
obj->state &= ~OBJ_STATE_UPDATE;
}
}

void
UG_ConsoleGetCursorPos(UG_S16* x, UG_S16* y)
{
if (gui == NULL) {
return;
}

UG_S16 xpos, ypos;

xpos = gui->console.x_pos;
ypos = gui->console.y_pos;

if (xpos >= gui->console.x_end) {
xpos = gui->console.x_start;
ypos += gui->font.char_height + gui->char_v_space;
}

if (y != NULL) {
*y = ypos;
}
if (x != NULL) {
*x = xpos;
}
}
2 changes: 2 additions & 0 deletions ugui.h
Original file line number Diff line number Diff line change
Expand Up @@ -936,6 +936,8 @@ UG_ConsoleSetForecolor(UG_COLOR c);
void
UG_ConsoleSetBackcolor(UG_COLOR c);
void
UG_ConsoleGetCursorPos(UG_S16* x, UG_S16* y);
void
UG_SetForecolor(UG_COLOR c);
void
UG_SetBackcolor(UG_COLOR c);
Expand Down

0 comments on commit 8dc7d8e

Please sign in to comment.