[vte/wip/egmont/bidi: 52/91] cursor: use member methods that protect against offscreen values
- From: Egmont Koblinger <egmontkob src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vte/wip/egmont/bidi: 52/91] cursor: use member methods that protect against offscreen values
- Date: Tue, 5 Feb 2019 19:20:23 +0000 (UTC)
commit 82fbe62a9bef3f00480b32017fcc21d5470e6ab6
Author: Egmont Koblinger <egmont gmail com>
Date: Wed Aug 29 01:01:10 2018 +0200
cursor: use member methods that protect against offscreen values
src/vte.cc | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
---
diff --git a/src/vte.cc b/src/vte.cc
index 5e9c1ee5..3ee3022d 100644
--- a/src/vte.cc
+++ b/src/vte.cc
@@ -9187,7 +9187,6 @@ 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);
while (cell != NULL && cell->attr.fragment() && cell->c != '\t' && col > 0) {
@@ -9196,12 +9195,12 @@ Terminal::paint_cursor()
}
/* Draw the cursor. */
- viscol = bidimap[col].log2vis;
+ viscol = m_ringview.log2vis(drow, col);
item.c = (cell && cell->c) ? cell->c : ' ';
item.columns = item.c == '\t' ? 1 : cell ? cell->attr.columns() : 1;
- item.x = (viscol - ((cell && bidimap[viscol].vis_rtl) ? cell->attr.columns() - 1 : 0)) * width;
+ item.x = (viscol - ((cell && m_ringview.vis_is_rtl(drow, viscol)) ? cell->attr.columns() - 1 : 0)) *
width;
item.y = row_to_pixel(drow);
- item.mirror = bidimap[viscol].vis_rtl;
+ item.mirror = m_ringview.vis_is_rtl(drow, viscol);
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]