aboutsummaryrefslogtreecommitdiff
path: root/src/libframe
diff options
context:
space:
mode:
authorRuss Cox <rsc@swtch.com>2011-01-02 17:54:48 -0500
committerRuss Cox <rsc@swtch.com>2011-01-02 17:54:48 -0500
commit5e90ec75ee98d867c7917e4f42a8a66d33f42647 (patch)
tree01931b7c2233a87d8483df6b84fc18cdca238af9 /src/libframe
parent839c052a938f78fde18b9b2431c24c6163e4a7f3 (diff)
downloadplan9port-5e90ec75ee98d867c7917e4f42a8a66d33f42647.tar.gz
plan9port-5e90ec75ee98d867c7917e4f42a8a66d33f42647.tar.bz2
plan9port-5e90ec75ee98d867c7917e4f42a8a66d33f42647.zip
libframe: fix line wrap display glitch (Erik Quanstrom)
R=rsc http://codereview.appspot.com/3777044
Diffstat (limited to 'src/libframe')
-rw-r--r--src/libframe/frdelete.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/libframe/frdelete.c b/src/libframe/frdelete.c
index 04ef6a09..e333abd8 100644
--- a/src/libframe/frdelete.c
+++ b/src/libframe/frdelete.c
@@ -9,7 +9,7 @@ frdelete(Frame *f, ulong p0, ulong p1)
{
Point pt0, pt1, ppt0;
Frbox *b;
- int n0, n1, n;
+ int n0, n1, n, w0;
ulong cn1;
Rectangle r;
int nn0;
@@ -52,6 +52,7 @@ frdelete(Frame *f, ulong p0, ulong p1)
r.max = pt0;
r.max.y += f->font->height;
if(b->nrune > 0){
+ w0 = b->wid;
if(n != b->nrune){
_frsplitbox(f, n1, n);
b = &f->box[n1];
@@ -59,6 +60,13 @@ frdelete(Frame *f, ulong p0, ulong p1)
r.max.x += b->wid;
draw(f->b, r, f->b, nil, pt1);
cn1 += b->nrune;
+
+ /* blank remainder of line */
+ r.min.x = r.max.x;
+ r.max.x += w0 - b->wid;
+ if(r.max.x > f->r.max.x)
+ r.max.x = f->r.max.x;
+ draw(f->b, r, f->cols[BACK], nil, r.min);
}else{
r.max.x += _frnewwid0(f, pt0, b);
if(r.max.x > f->r.max.x)