summaryrefslogtreecommitdiff
path: root/src/nsterm.m
diff options
context:
space:
mode:
authorAlp Aker <alp.tekin.aker@gmail.com>2011-07-28 14:41:21 -0400
committerChong Yidong <cyd@stupidchicken.com>2011-07-28 14:41:21 -0400
commitbf3492a57ec757c0efadb6e821daa507e499057d (patch)
tree0e7547c2383c04fe6f862543ee8b85d9a3d6a9bf /src/nsterm.m
parentbe8ec0b3d40a22b9cb180d7cb3c9d22c81c64f14 (diff)
downloademacs-bf3492a57ec757c0efadb6e821daa507e499057d.tar.gz
Fix display artifacts from ns_dumpglyphs_stretch (Bug#8470).
* src/nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe or scroll bar.
Diffstat (limited to 'src/nsterm.m')
-rw-r--r--src/nsterm.m18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/nsterm.m b/src/nsterm.m
index e9e7dcc0804..d4b1a3f8473 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -3110,12 +3110,24 @@ ns_dumpglyphs_stretch (struct glyph_string *s)
{
if (!s->row->full_width_p)
{
+ int overrun, leftoverrun;
+
/* truncate to avoid overwriting fringe and/or scrollbar */
- int overrun = max (0, (s->x + s->background_width)
- - (WINDOW_BOX_RIGHT_EDGE_X (s->w)
- - WINDOW_RIGHT_FRINGE_WIDTH (s->w)));
+ overrun = max (0, (s->x + s->background_width)
+ - (WINDOW_BOX_RIGHT_EDGE_X (s->w)
+ - WINDOW_RIGHT_FRINGE_WIDTH (s->w)));
r[i].size.width -= overrun;
+ /* truncate to avoid overwriting to left of the window box */
+ leftoverrun = (WINDOW_BOX_LEFT_EDGE_X (s->w)
+ + WINDOW_LEFT_FRINGE_WIDTH (s->w)) - s->x;
+
+ if (leftoverrun > 0)
+ {
+ r[i].origin.x += leftoverrun;
+ r[i].size.width -= leftoverrun;
+ }
+
/* XXX: Try to work between problem where a stretch glyph on
a partially-visible bottom row will clear part of the
modeline, and another where list-buffers headers and similar