[vte/wip/mosaic: 7/8] draw: Improve diagnoals drawing
- From: Christian Persch <chpe src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vte/wip/mosaic: 7/8] draw: Improve diagnoals drawing
- Date: Thu, 14 Nov 2019 22:10:07 +0000 (UTC)
commit 2a56b742910ddad2eaea76424b7894168dc1d787
Author: Christian Persch <chpe src gnome org>
Date: Thu Nov 14 23:09:22 2019 +0100
draw: Improve diagnoals drawing
Make the diagonals contiguous by allowing them to slightly extend
outside the cell on the left and right.
src/vtedraw.cc | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
---
diff --git a/src/vtedraw.cc b/src/vtedraw.cc
index 9fad9495..2a10c4e9 100644
--- a/src/vtedraw.cc
+++ b/src/vtedraw.cc
@@ -1499,17 +1499,19 @@ _vte_draw_terminal_draw_graphic(struct _vte_draw *draw,
case 0x2572: /* box drawings light diagonal upper left to lower right */
case 0x2573: /* box drawings light diagonal cross */
{
- cairo_set_line_cap(cr, CAIRO_LINE_CAP_ROUND);
+ auto const dx = (light_line_width + 1) / 2;
+ cairo_rectangle(cr, x - dx, y, width + 2 * dx, height);
+ cairo_clip(cr);
+ cairo_set_line_cap(cr, CAIRO_LINE_CAP_SQUARE);
cairo_set_line_width(cr, light_line_width);
- adjust = light_line_width / 2.;
if (c != 0x2571) {
- cairo_move_to(cr, x + adjust, y + adjust);
- cairo_line_to(cr, xright - adjust, ybottom - adjust);
+ cairo_move_to(cr, x, y);
+ cairo_line_to(cr, xright, ybottom);
cairo_stroke(cr);
}
if (c != 0x2572) {
- cairo_move_to(cr, xright - adjust, y + adjust);
- cairo_line_to(cr, x + adjust, ybottom - adjust);
+ cairo_move_to(cr, xright, y);
+ cairo_line_to(cr, x, ybottom);
cairo_stroke(cr);
}
break;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]