[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] emacs-24 aa472a3: Fix the pixel coordinates returned by po
From: |
Eli Zaretskii |
Subject: |
[Emacs-diffs] emacs-24 aa472a3: Fix the pixel coordinates returned by pos-visible-in-window-p. (Bug#19473) |
Date: |
Tue, 30 Dec 2014 17:31:41 +0000 |
branch: emacs-24
commit aa472a377134b7840fd7b9c97f948fb9440e6e9d
Author: Eli Zaretskii <address@hidden>
Commit: Eli Zaretskii <address@hidden>
Fix the pixel coordinates returned by pos-visible-in-window-p. (Bug#19473)
src/xdisp.c (pos_visible_p): Fix up the X coordinate for
right-to-left screen lines.
---
src/ChangeLog | 5 +++++
src/xdisp.c | 23 +++++++++++++++++++----
2 files changed, 24 insertions(+), 4 deletions(-)
diff --git a/src/ChangeLog b/src/ChangeLog
index 94f07c8..21303f2 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
+2014-12-30 Eli Zaretskii <address@hidden>
+
+ * xdisp.c (pos_visible_p): Fix up the X coordinate for
+ right-to-left screen lines. (Bug#19473)
+
2014-12-28 Eli Zaretskii <address@hidden>
* w32proc.c (Fw32_get_codepage_charset): Doc fix. (Bug#19458)
diff --git a/src/xdisp.c b/src/xdisp.c
index 173df5d..f0a851a 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -1403,6 +1403,7 @@ pos_visible_p (struct window *w, ptrdiff_t charpos, int
*x, int *y,
struct text_pos top;
int visible_p = 0;
struct buffer *old_buffer = NULL;
+ bool r2l = false;
if (FRAME_INITIAL_P (XFRAME (WINDOW_FRAME (w))))
return visible_p;
@@ -1688,6 +1689,8 @@ pos_visible_p (struct window *w, ptrdiff_t charpos, int
*x, int *y,
*rowh = max (0, (min (bottom_y, it.last_visible_y)
- max (top_y, window_top_y)));
*vpos = it.vpos;
+ if (it.bidi_it.paragraph_dir == R2L)
+ r2l = true;
}
}
else
@@ -1717,6 +1720,8 @@ pos_visible_p (struct window *w, ptrdiff_t charpos, int
*x, int *y,
- max (it2.current_y,
WINDOW_HEADER_LINE_HEIGHT (w))));
*vpos = it2.vpos;
+ if (it2.bidi_it.paragraph_dir == R2L)
+ r2l = true;
}
else
bidi_unshelve_cache (it2data, 1);
@@ -1726,10 +1731,20 @@ pos_visible_p (struct window *w, ptrdiff_t charpos, int
*x, int *y,
if (old_buffer)
set_buffer_internal_1 (old_buffer);
- if (visible_p && w->hscroll > 0)
- *x -=
- window_hscroll_limited (w, WINDOW_XFRAME (w))
- * WINDOW_FRAME_COLUMN_WIDTH (w);
+ if (visible_p)
+ {
+ if (w->hscroll > 0)
+ *x -=
+ window_hscroll_limited (w, WINDOW_XFRAME (w))
+ * WINDOW_FRAME_COLUMN_WIDTH (w);
+ /* For lines in an R2L paragraph, we need to mirror the X pixel
+ coordinate wrt the text area. For the reasons, see the
+ commentary in buffer_posn_from_coords and the explanation of
+ the geometry used by the move_it_* functions at the end of
+ the large commentart near the beginning of this file. */
+ if (r2l)
+ *x = window_box_width (w, TEXT_AREA) - *x - 1;
+ }
#if 0
/* Debugging code. */
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] emacs-24 aa472a3: Fix the pixel coordinates returned by pos-visible-in-window-p. (Bug#19473),
Eli Zaretskii <=