Skip to content

Commit

Permalink
fonts: advance cursor in writeln
Browse files Browse the repository at this point in the history
  • Loading branch information
vroland committed May 4, 2020
1 parent f8bdeb3 commit 98f50ff
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions components/epd_driver/font.c
Original file line number Diff line number Diff line change
Expand Up @@ -195,10 +195,16 @@ void writeln(GFXfont *font, char *string, int *cursor_x, int *cursor_y,

uint32_t c;

int cursor_x_init = local_cursor_x;
int cursor_y_init = local_cursor_y;

while ((c = next_cp((uint8_t**)&string))) {
draw_char(font, buffer, &local_cursor_x, local_cursor_y, buf_width, buf_height, c);
}

*cursor_x += local_cursor_x - cursor_x_init;
*cursor_y += local_cursor_y - cursor_y_init;

if (framebuffer == NULL) {
Rect_t area = {
.x = x1, .y = *cursor_y - h + baseline_height, .width = w, .height = h};
Expand Down

0 comments on commit 98f50ff

Please sign in to comment.