summaryrefslogtreecommitdiff
path: root/src/dispnew.c
diff options
context:
space:
mode:
authorGlenn Morris <rgm@gnu.org>2014-08-27 18:59:29 -0700
committerGlenn Morris <rgm@gnu.org>2014-08-27 18:59:29 -0700
commit6d26235315194737c4dc8653cf6d05177a10fa9c (patch)
tree4a80f49f2073d80610931dd8706e90527a98340b /src/dispnew.c
parent93b31b57283d369fefc5c95082d7b09288f05128 (diff)
parentb62da77c1c94b393f8be7854ff1cb30b012aa238 (diff)
downloademacs-6d26235315194737c4dc8653cf6d05177a10fa9c.tar.gz
Merge from emacs-24; up to 2014-07-02T00:57:53Z!juri@jurta.org
Diffstat (limited to 'src/dispnew.c')
-rw-r--r--src/dispnew.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/dispnew.c b/src/dispnew.c
index b587852fc6e..43ffca7c181 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -5143,9 +5143,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);
/* TO_X is the pixel position that the iterator will compute for the
- glyph at *X. We add it.first_visible_x because iterator
- positions include the hscroll. */
- to_x = x0 + it.first_visible_x;
+ glyph at *X. */
+ to_x = x0;
if (it.bidi_it.paragraph_dir == R2L)
/* For lines in an R2L paragraph, we need to mirror TO_X wrt the
text area. This is because the iterator, even in R2L
@@ -5159,6 +5158,10 @@ buffer_posn_from_coords (struct window *w, int *x, int *y, struct display_pos *p
it should be mirrored into zero pixel position.) */
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
argument is ZV to prevent move_it_in_display_line from matching
based on buffer positions. */