From: yu.dongliang <18588496441@163.com> Date: Mon, 30 Oct 2023 04:20:47 +0000 (+0800) Subject: ses_layout_draw() X-Git-Url: http://baseworks.info/?a=commitdiff_plain;h=02d01ba898c4448180ed8226c8c446b3bfadc746;p=ses.git ses_layout_draw() --- diff --git a/ses_layout.c b/ses_layout.c index 8307370..c52b134 100644 --- a/ses_layout.c +++ b/ses_layout.c @@ -1193,25 +1193,57 @@ int ses_layout_draw(ScfEboard* b, uint32_t bx, uint32_t by, uint32_t bw, uint32_ cairo_line_to (cr, c->x - dx3, c->y - dy3); cairo_rel_move_to(cr, dx0, dy0); cairo_rel_line_to(cr, -dx0 * 2, -dy0 * 2); + cairo_stroke(cr); - cairo_move_to(cr, c->x - dx3, c->y - dy3); - cairo_line_to(cr, c->x + dx3 + dx0, c->y + dy3 + dy0); - cairo_line_to(cr, pe->x, pe->y); + if ((c->x + dx3 + dx0 > c->x + dx3 - dx0 && pe->x > pc->x) + || (c->x + dx3 + dx0 < c->x + dx3 - dx0 && pe->x < pc->x)) { - vertical(&dx1, &dy1, dx3 * 2 + dx0, dy3 * 2 + dy0, 3); - forward (&dx4, &dy4, dx3 * 2 + dx0, dy3 * 2 + dy0, 8); + cairo_set_source_rgb(cr, 0.6, 0.6, 0.0); + cairo_set_line_width(cr, 2); - cairo_move_to(cr, c->x - dx3 + dx4 + dx1, c->y - dy3 + dy4 + dy1); - cairo_line_to(cr, c->x + dx3 + dx0, c->y + dy3 + dy0); - cairo_line_to(cr, c->x - dx3 + dx4 - dx1, c->y - dy3 + dy4 - dy1); - cairo_stroke(cr); + cairo_move_to(cr, c->x - dx3, c->y - dy3); + cairo_line_to(cr, c->x + dx3 + dx0, c->y + dy3 + dy0); + cairo_line_to(cr, pe->x, pe->y); - cairo_set_source_rgb(cr, 0.0, 0.6, 0.0); - cairo_set_line_width(cr, 2.5); - cairo_move_to(cr, c->x - dx3, c->y - dy3); - cairo_line_to(cr, c->x + dx3 - dx0, c->y + dy3 - dy0); - cairo_line_to(cr, pc->x, pc->y); - cairo_stroke(cr); + vertical(&dx1, &dy1, dx3 * 2 + dx0, dy3 * 2 + dy0, 3); + forward (&dx4, &dy4, dx3 * 2 + dx0, dy3 * 2 + dy0, 8); + + cairo_move_to(cr, c->x - dx3 + dx4 + dx1, c->y - dy3 + dy4 + dy1); + cairo_line_to(cr, c->x + dx3 + dx0, c->y + dy3 + dy0); + cairo_line_to(cr, c->x - dx3 + dx4 - dx1, c->y - dy3 + dy4 - dy1); + cairo_stroke(cr); + + cairo_set_source_rgb(cr, 0.0, 0.6, 0.0); + cairo_set_line_width(cr, 2.5); + cairo_move_to(cr, c->x - dx3, c->y - dy3); + cairo_line_to(cr, c->x + dx3 - dx0, c->y + dy3 - dy0); + cairo_line_to(cr, pc->x, pc->y); + cairo_stroke(cr); + + } else { + cairo_set_source_rgb(cr, 0.0, 0.6, 0.0); + cairo_set_line_width(cr, 2.5); + cairo_move_to(cr, c->x - dx3, c->y - dy3); + cairo_line_to(cr, c->x + dx3 + dx0, c->y + dy3 + dy0); + cairo_line_to(cr, pc->x, pc->y); + cairo_stroke(cr); + + cairo_set_source_rgb(cr, 0.6, 0.6, 0.0); + cairo_set_line_width(cr, 2); + + cairo_move_to(cr, c->x - dx3, c->y - dy3); + cairo_line_to(cr, c->x + dx3 - dx0, c->y + dy3 - dy0); + cairo_line_to(cr, pe->x, pe->y); + + vertical(&dx1, &dy1, dx3 * 2 - dx0, dy3 * 2 - dy0, 3); + forward (&dx4, &dy4, dx3 * 2 - dx0, dy3 * 2 - dy0, 8); + + cairo_move_to(cr, c->x - dx3 + dx4 + dx1, c->y - dy3 + dy4 + dy1); + cairo_line_to(cr, c->x + dx3 - dx0, c->y + dy3 - dy0); + cairo_line_to(cr, c->x - dx3 + dx4 - dx1, c->y - dy3 + dy4 - dy1); + + cairo_stroke(cr); + } break; default: break;