diff options
| author | Eli Zaretskii | 2010-08-18 19:42:06 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2010-08-18 19:42:06 +0300 |
| commit | 9335210608653cef7a111d096dcfacd7bd87682a (patch) | |
| tree | 4b2d8db0f1d851f9dc890793d214613fc75ad228 /src | |
| parent | b5ba2d6f9bdd21771f5dbad663396eef2ec057c8 (diff) | |
| download | emacs-9335210608653cef7a111d096dcfacd7bd87682a.tar.gz emacs-9335210608653cef7a111d096dcfacd7bd87682a.zip | |
Fix display of bar cursor on right-to-left text.
xterm.c (x_draw_bar_cursor):
w32term.c (x_draw_bar_cursor): If the character under cursor is
R2L, draw the bar cursor on its right rather than on its left.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 6 | ||||
| -rw-r--r-- | src/w32term.c | 5 | ||||
| -rw-r--r-- | src/xterm.c | 5 |
3 files changed, 16 insertions, 0 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 45cccea1ebb..4033a424aed 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2010-08-18 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | * xterm.c (x_draw_bar_cursor): | ||
| 4 | * w32term.c (x_draw_bar_cursor): If the character under cursor is | ||
| 5 | R2L, draw the bar cursor on its right rather than on its left. | ||
| 6 | |||
| 1 | 2010-08-18 Stefan Monnier <monnier@iro.umontreal.ca> | 7 | 2010-08-18 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 8 | ||
| 3 | * eval.c (Fdefmacro): Only obey one declaration. | 9 | * eval.c (Fdefmacro): Only obey one declaration. |
diff --git a/src/w32term.c b/src/w32term.c index 947ed5c9d44..992538e0e88 100644 --- a/src/w32term.c +++ b/src/w32term.c | |||
| @@ -4897,6 +4897,11 @@ x_draw_bar_cursor (struct window *w, struct glyph_row *row, | |||
| 4897 | 4897 | ||
| 4898 | w->phys_cursor_width = width; | 4898 | w->phys_cursor_width = width; |
| 4899 | 4899 | ||
| 4900 | /* If the character under cursor is R2L, draw the bar cursor | ||
| 4901 | on the right of its glyph, rather than on the left. */ | ||
| 4902 | if ((cursor_glyph->resolved_level & 1) != 0) | ||
| 4903 | x += cursor_glyph->pixel_width - width; | ||
| 4904 | |||
| 4900 | w32_fill_area (f, hdc, cursor_color, x, | 4905 | w32_fill_area (f, hdc, cursor_color, x, |
| 4901 | WINDOW_TO_FRAME_PIXEL_Y (w, w->phys_cursor.y), | 4906 | WINDOW_TO_FRAME_PIXEL_Y (w, w->phys_cursor.y), |
| 4902 | width, row->height); | 4907 | width, row->height); |
diff --git a/src/xterm.c b/src/xterm.c index 4325fb3d991..420c5ccc7fd 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -7158,6 +7158,11 @@ x_draw_bar_cursor (struct window *w, struct glyph_row *row, int width, enum text | |||
| 7158 | 7158 | ||
| 7159 | w->phys_cursor_width = width; | 7159 | w->phys_cursor_width = width; |
| 7160 | 7160 | ||
| 7161 | /* If the character under cursor is R2L, draw the bar cursor | ||
| 7162 | on the right of its glyph, rather than on the left. */ | ||
| 7163 | if ((cursor_glyph->resolved_level & 1) != 0) | ||
| 7164 | x += cursor_glyph->pixel_width - width; | ||
| 7165 | |||
| 7161 | XFillRectangle (dpy, window, gc, | 7166 | XFillRectangle (dpy, window, gc, |
| 7162 | WINDOW_TEXT_TO_FRAME_PIXEL_X (w, w->phys_cursor.x), | 7167 | WINDOW_TEXT_TO_FRAME_PIXEL_X (w, w->phys_cursor.x), |
| 7163 | WINDOW_TO_FRAME_PIXEL_Y (w, w->phys_cursor.y), | 7168 | WINDOW_TO_FRAME_PIXEL_Y (w, w->phys_cursor.y), |