summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2014-08-31 18:46:47 +0300
committerEli Zaretskii <eliz@gnu.org>2014-08-31 18:46:47 +0300
commit4457cc825bdbe30f704c80edbae25d12e7e5bab2 (patch)
tree8988d99dd1e08e031bc4de5b8ff0614956932a59
parent53d815b09fe53c749acce4c8aaf427367050f2bd (diff)
downloademacs-4457cc825bdbe30f704c80edbae25d12e7e5bab2.tar.gz
Fix cursor drawing in hscrolled R2L screen lines.
src/xdisp.c (get_glyph_string_clip_rects): Don't let the width of a clipping rectangle become negative (i.e. large positive, since it's an unsigned data type). This can happen in R2L hscrolled glyph rows, and caused us to draw the cursor glyph on the fringe. For the details, see http://lists.gnu.org/archive/html/emacs-devel/2014-08/msg00543.html.
-rw-r--r--src/ChangeLog9
-rw-r--r--src/xdisp.c5
2 files changed, 13 insertions, 1 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 8f2e01f8cf9..26ee524acda 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,12 @@
+2014-08-31 Eli Zaretskii <eliz@gnu.org>
+
+ * xdisp.c (get_glyph_string_clip_rects): Don't let the width of a
+ clipping rectangle become negative (i.e. large positive, since
+ it's an unsigned data type). This can happen in R2L hscrolled
+ glyph rows, and caused us to draw the cursor glyph on the fringe.
+ For the details, see
+ http://lists.gnu.org/archive/html/emacs-devel/2014-08/msg00543.html.
+
2014-08-31 Ken Brown <kbrown@cornell.edu>
* gmalloc.c: Don't include <stdlib.h>. Declare system malloc and
diff --git a/src/xdisp.c b/src/xdisp.c
index 2b12dd8f557..4383c497d7a 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -2174,7 +2174,10 @@ get_glyph_string_clip_rects (struct glyph_string *s, NativeRectangle *rects, int
if (s->x > r.x)
{
- r.width -= s->x - r.x;
+ if (r.width >= s->x - r.x)
+ r.width -= s->x - r.x;
+ else /* R2L hscrolled row with cursor outside text area */
+ r.width = 0;
r.x = s->x;
}
r.width = min (r.width, glyph->pixel_width);