From d215ccb896bb8a33dda65361a9302bcc4b2c7a8a Mon Sep 17 00:00:00 2001 From: "yu.dongliang" <18588496441@163.com> Date: Thu, 13 Jul 2023 14:41:45 +0800 Subject: [PATCH] draw line number --- ses_layout.c | 9 +++++++++ 1 file changed, 9 insertions(+) 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); } } -- 2.25.1