[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] emacs-24 r117417: Fix display of R2L lines when the last c
From: |
Eli Zaretskii |
Subject: |
[Emacs-diffs] emacs-24 r117417: Fix display of R2L lines when the last character fits only partially. |
Date: |
Fri, 01 Aug 2014 09:39:40 +0000 |
User-agent: |
Bazaar (2.6b2) |
------------------------------------------------------------
revno: 117417
revision-id: address@hidden
parent: address@hidden
committer: Eli Zaretskii <address@hidden>
branch nick: emacs-24
timestamp: Fri 2014-08-01 12:39:04 +0300
message:
Fix display of R2L lines when the last character fits only partially.
See http://lists.gnu.org/archive/html/emacs-devel/2014-07/msg00476.html
for the details.
src/xdisp.c (extend_face_to_end_of_line): If the last glyph of an
R2L row is visible only partially, give the row a negative x
offset.
(display_line): Fix the calculation of the glyph whose pixel width
is used to decide whether the last produced glyph fits on the
line. When the last glyph fits only partially, give the row a
negative x offset.
modified:
src/ChangeLog changelog-20091113204419-o5vbwnq5f7feedwu-1438
src/xdisp.c xdisp.c-20091113204419-o5vbwnq5f7feedwu-240
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog 2014-07-29 08:19:29 +0000
+++ b/src/ChangeLog 2014-08-01 09:39:04 +0000
@@ -1,3 +1,16 @@
+2014-08-01 Eli Zaretskii <address@hidden>
+
+ Fix display of R2L lines when the last character fits only partially.
+ See http://lists.gnu.org/archive/html/emacs-devel/2014-07/msg00476.html
+ for the details.
+ * xdisp.c (extend_face_to_end_of_line): If the last glyph of an
+ R2L row is visible only partially, give the row a negative x
+ offset.
+ (display_line): Fix the calculation of the glyph whose pixel width
+ is used to decide whether the last produced glyph fits on the
+ line. When the last glyph fits only partially, give the row a
+ negative x offset.
+
2014-07-29 Eli Zaretskii <address@hidden>
Fix hscroll of R2L lines that begin with a TAB or another wide glyph.
=== modified file 'src/xdisp.c'
--- a/src/xdisp.c 2014-07-29 08:19:29 +0000
+++ b/src/xdisp.c 2014-08-01 09:39:04 +0000
@@ -19316,6 +19316,12 @@
it->face_id = saved_face_id;
it->start_of_box_run_p = saved_box_start;
}
+ /* If stretch_width comes out negative, it means that the
+ last glyph is only partially visible. In R2L rows, we
+ want the leftmost glyph to be partially visible, so we
+ need to give the row the corresponding left offset. */
+ if (stretch_width < 0)
+ it->glyph_row->x = stretch_width;
}
#endif /* HAVE_WINDOW_SYSTEM */
}
@@ -20207,7 +20213,13 @@
for (i = 0; i < nglyphs; ++i, x = new_x)
{
- glyph = row->glyphs[TEXT_AREA] + n_glyphs_before + i;
+ /* Identify the glyphs added by the last call to
+ PRODUCE_GLYPHS. In R2L rows, they are prepended to
+ the previous glyphs. */
+ if (!row->reversed_p)
+ glyph = row->glyphs[TEXT_AREA] + n_glyphs_before + i;
+ else
+ glyph = row->glyphs[TEXT_AREA] + nglyphs - 1 - i;
new_x = x + glyph->pixel_width;
if (/* Lines are continued. */
@@ -20415,6 +20427,12 @@
suitable change to the stretch glyph that is
the leftmost glyph of the line. */
row->x = x - it->first_visible_x;
+ /* When the last glyph of an R2L row only fits
+ partially on the line, we need to set row->x to a
+ negative offset, so that the leftmost glyph is
+ the one that is partially visible. */
+ if (row->reversed_p && new_x > it->last_visible_x)
+ row->x = it->last_visible_x - new_x;
}
else
{
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] emacs-24 r117417: Fix display of R2L lines when the last character fits only partially.,
Eli Zaretskii <=