aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2014-08-17 17:34:05 +0300
committerEli Zaretskii2014-08-17 17:34:05 +0300
commitf7abe0af306f08ab225815adf28fecf7856befe7 (patch)
treee4ead02754559e304e602b445f319620add4b557
parent315865d31dde9f0771f96a98a4562bd282aa21ea (diff)
downloademacs-f7abe0af306f08ab225815adf28fecf7856befe7.tar.gz
emacs-f7abe0af306f08ab225815adf28fecf7856befe7.zip
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.
-rw-r--r--src/ChangeLog5
-rw-r--r--src/dispnew.c9
2 files changed, 11 insertions, 3 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 628fa26d778..68f6babb991 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
12014-08-17 Eli Zaretskii <eliz@gnu.org>
2
3 * dispnew.c (buffer_posn_from_coords): Fix mirroring of X
4 coordinate for hscrolled R2L screen lines. (Bug#18277)
5
12014-08-11 Ken Brown <kbrown@cornell.edu> 62014-08-11 Ken Brown <kbrown@cornell.edu>
2 7
3 * gmalloc.c (_malloc_mutex, _aligned_blocks_mutex) [CYGWIN]: Use 8 * gmalloc.c (_malloc_mutex, _aligned_blocks_mutex) [CYGWIN]: Use
diff --git a/src/dispnew.c b/src/dispnew.c
index 7be4e0b4615..e6ab5bf1e9c 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -5129,9 +5129,8 @@ buffer_posn_from_coords (struct window *w, int *x, int *y, struct display_pos *p
5129 move_it_to (&it, -1, 0, *y, -1, MOVE_TO_X | MOVE_TO_Y); 5129 move_it_to (&it, -1, 0, *y, -1, MOVE_TO_X | MOVE_TO_Y);
5130 5130
5131 /* TO_X is the pixel position that the iterator will compute for the 5131 /* TO_X is the pixel position that the iterator will compute for the
5132 glyph at *X. We add it.first_visible_x because iterator 5132 glyph at *X. */
5133 positions include the hscroll. */ 5133 to_x = x0;
5134 to_x = x0 + it.first_visible_x;
5135 if (it.bidi_it.paragraph_dir == R2L) 5134 if (it.bidi_it.paragraph_dir == R2L)
5136 /* For lines in an R2L paragraph, we need to mirror TO_X wrt the 5135 /* For lines in an R2L paragraph, we need to mirror TO_X wrt the
5137 text area. This is because the iterator, even in R2L 5136 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 it should be mirrored into zero pixel position.) */ 5144 it should be mirrored into zero pixel position.) */
5146 to_x = window_box_width (w, TEXT_AREA) - to_x - 1; 5145 to_x = window_box_width (w, TEXT_AREA) - to_x - 1;
5147 5146
5147 /* We need to add it.first_visible_x because iterator positions
5148 include the hscroll. */
5149 to_x += it.first_visible_x;
5150
5148 /* Now move horizontally in the row to the glyph under *X. Second 5151 /* Now move horizontally in the row to the glyph under *X. Second
5149 argument is ZV to prevent move_it_in_display_line from matching 5152 argument is ZV to prevent move_it_in_display_line from matching
5150 based on buffer positions. */ 5153 based on buffer positions. */