Commit f7abe0af authored by Eli Zaretskii's avatar Eli Zaretskii
Browse files

Fix bug #18277 with mouse clicks on R2L lines.

 src/dispnew.c (buffer_posn_from_coords): Fix mirroring of X
 coordinate for hscrolled R2L screen lines.
parent 315865d3
2014-08-17 Eli Zaretskii <eliz@gnu.org>
* dispnew.c (buffer_posn_from_coords): Fix mirroring of X
coordinate for hscrolled R2L screen lines. (Bug#18277)
2014-08-11 Ken Brown <kbrown@cornell.edu> 2014-08-11 Ken Brown <kbrown@cornell.edu>
* gmalloc.c (_malloc_mutex, _aligned_blocks_mutex) [CYGWIN]: Use * gmalloc.c (_malloc_mutex, _aligned_blocks_mutex) [CYGWIN]: Use
......
...@@ -5129,9 +5129,8 @@ buffer_posn_from_coords (struct window *w, int *x, int *y, struct display_pos *p ...@@ -5129,9 +5129,8 @@ buffer_posn_from_coords (struct window *w, int *x, int *y, struct display_pos *p
move_it_to (&it, -1, 0, *y, -1, MOVE_TO_X | MOVE_TO_Y); move_it_to (&it, -1, 0, *y, -1, MOVE_TO_X | MOVE_TO_Y);
/* TO_X is the pixel position that the iterator will compute for the /* TO_X is the pixel position that the iterator will compute for the
glyph at *X. We add it.first_visible_x because iterator glyph at *X. */
positions include the hscroll. */ to_x = x0;
to_x = x0 + it.first_visible_x;
if (it.bidi_it.paragraph_dir == R2L) if (it.bidi_it.paragraph_dir == R2L)
/* For lines in an R2L paragraph, we need to mirror TO_X wrt the /* For lines in an R2L paragraph, we need to mirror TO_X wrt the
text area. This is because the iterator, even in R2L text area. This is because the iterator, even in R2L
...@@ -5145,6 +5144,10 @@ buffer_posn_from_coords (struct window *w, int *x, int *y, struct display_pos *p ...@@ -5145,6 +5144,10 @@ buffer_posn_from_coords (struct window *w, int *x, int *y, struct display_pos *p
it should be mirrored into zero pixel position.) */ it should be mirrored into zero pixel position.) */
to_x = window_box_width (w, TEXT_AREA) - to_x - 1; to_x = window_box_width (w, TEXT_AREA) - to_x - 1;
/* We need to add it.first_visible_x because iterator positions
include the hscroll. */
to_x += it.first_visible_x;
/* Now move horizontally in the row to the glyph under *X. Second /* Now move horizontally in the row to the glyph under *X. Second
argument is ZV to prevent move_it_in_display_line from matching argument is ZV to prevent move_it_in_display_line from matching
based on buffer positions. */ based on buffer positions. */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment