diff options
author | Eli Zaretskii <eliz@gnu.org> | 2010-08-14 15:55:04 +0300 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2010-08-14 15:55:04 +0300 |
commit | b236615c100961c3f4c555634ac56d51e723e43a (patch) | |
tree | 65c008fb06fafe5a5a9f509cc95b0cf81f035874 /src/w32term.c | |
parent | 5872c762ed0f6123bc1c45168c0695fcd2e94948 (diff) | |
download | emacs-b236615c100961c3f4c555634ac56d51e723e43a.tar.gz |
Fix cursor drawing on stretch glyphs in R2L lines.
xterm.c (x_draw_stretch_glyph_string):
w32term.c (x_draw_stretch_glyph_string): In R2L rows, display the
cursor on the right edge of the stretch glyph.
xdisp.c (window_box_right_offset, window_box_right): Fix commentary.
Diffstat (limited to 'src/w32term.c')
-rw-r--r-- | src/w32term.c | 34 |
1 files changed, 27 insertions, 7 deletions
diff --git a/src/w32term.c b/src/w32term.c index fc03034b14b..947ed5c9d44 100644 --- a/src/w32term.c +++ b/src/w32term.c @@ -2106,17 +2106,34 @@ x_draw_stretch_glyph_string (struct glyph_string *s) if (s->hl == DRAW_CURSOR && !x_stretch_cursor_p) { - /* If `x-stretch-block-cursor' is nil, don't draw a block cursor - as wide as the stretch glyph. */ + /* If `x-stretch-cursor' is nil, don't draw a block cursor as + wide as the stretch glyph. */ int width, background_width = s->background_width; - int x = s->x, left_x = window_box_left_offset (s->w, TEXT_AREA); + int x = s->x; - if (x < left_x) + if (!s->row->reversed_p) { - background_width -= left_x - x; - x = left_x; + int left_x = window_box_left_offset (s->w, TEXT_AREA); + + if (x < left_x) + { + background_width -= left_x - x; + x = left_x; + } + } + else + { + /* In R2L rows, draw the cursor on the right edge of the + stretch glyph. */ + int right_x = window_box_right_offset (s->w, TEXT_AREA); + + if (x + background_width > right_x) + background_width -= x - right_x; + x += background_width; } width = min (FRAME_COLUMN_WIDTH (s->f), background_width); + if (s->row->reversed_p) + x -= width; /* Draw cursor. */ x_draw_glyph_string_bg_rect (s, x, s->y, width, s->height); @@ -2130,7 +2147,10 @@ x_draw_stretch_glyph_string (struct glyph_string *s) RECT r; HDC hdc = s->hdc; - x += width; + if (!s->row->reversed_p) + x += width; + else + x = s->x; if (s->row->mouse_face_p && cursor_in_mouse_face_p (s->w)) { |