[vte/wip/egmont/bidi: 49/73] fix cursor on double wide rtl or mirrored box drawing
- From: Egmont Koblinger <egmontkob src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vte/wip/egmont/bidi: 49/73] fix cursor on double wide rtl or mirrored box drawing
- Date: Sun, 23 Sep 2018 11:04:04 +0000 (UTC)
commit e5eb71befd312ecc5b92325069073756e4899753
Author: Egmont Koblinger <egmont gmail com>
Date: Wed Aug 29 00:24:11 2018 +0200
fix cursor on double wide rtl or mirrored box drawing
src/vte.cc | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/src/vte.cc b/src/vte.cc
index 07e3af50..efc2dd86 100644
--- a/src/vte.cc
+++ b/src/vte.cc
@@ -9064,7 +9064,7 @@ Terminal::paint_cursor()
{
struct _vte_draw_text_request item;
vte::grid::row_t drow;
- vte::grid::column_t col;
+ vte::grid::column_t col, viscol;
int width, height, cursor_width;
guint style = 0;
guint fore, back, deco;
@@ -9109,6 +9109,7 @@ Terminal::paint_cursor()
/* Find the first cell of the character "under" the cursor.
* This is for CJK. For TAB, paint the cursor where it really is. */
+ VteRowData const *row_data = find_row_data(drow);
bidicellmap const *bidimap = m_ringview.get_row_map(drow);
auto cell = find_charcell(col, drow);
@@ -9118,10 +9119,13 @@ Terminal::paint_cursor()
}
/* Draw the cursor. */
+ viscol = bidimap[col].log2vis;
item.c = (cell && cell->c) ? cell->c : ' ';
item.columns = item.c == '\t' ? 1 : cell ? cell->attr.columns() : 1;
- item.x = bidimap[col].log2vis * width;
+ item.x = (viscol - (bidimap[viscol].vis_rtl ? cell->attr.columns() - 1 : 0)) * width;
item.y = row_to_pixel(drow);
+ item.mirror = bidimap[viscol].vis_rtl;
+ item.box_mirror = (row_data && (row_data->attr.bidi_flags & VTE_BIDI_BOX_MIRROR));
if (cell && cell->c != 0) {
style = _vte_draw_get_style(cell->attr.bold(), cell->attr.italic());
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]