From: yu.dongliang <18588496441@163.com> Date: Thu, 13 Jul 2023 06:41:45 +0000 (+0800) Subject: draw line number X-Git-Url: http://baseworks.info/?a=commitdiff_plain;h=d215ccb896bb8a33dda65361a9302bcc4b2c7a8a;p=ses.git draw line number --- diff --git a/ses_layout.c b/ses_layout.c index cf08c91..f8aed09 100644 --- a/ses_layout.c +++ b/ses_layout.c @@ -644,6 +644,15 @@ int ses_layout_draw(ScfEboard* b, uint32_t bx, uint32_t by, uint32_t bw, uint32_ cairo_move_to(cr, l->x0, l->y0); cairo_line_to(cr, l->x1, l->y1); } + + uint8_t text[64]; + snprintf(text, sizeof(text) - 1, "%ld", el->id); + + cairo_select_font_face(cr, "Georgia", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD); + cairo_set_font_size (cr, 20); + cairo_move_to (cr, l->x0 - 10, l->y0 + 5); + cairo_show_text (cr, text); + cairo_stroke(cr); } }