diff options
author | Russ Cox <rsc@swtch.com> | 2008-03-07 07:47:54 -0500 |
---|---|---|
committer | Russ Cox <rsc@swtch.com> | 2008-03-07 07:47:54 -0500 |
commit | 0cd1385d9f8a151fa1e42dfbac4d16d35a6056d0 (patch) | |
tree | 283981d545e33c45c4a64e8d897b82c966fd124a /src/cmd | |
parent | 5e22f11b97dc97ca6dd449d4efec1838c996cb0c (diff) | |
download | plan9port-0cd1385d9f8a151fa1e42dfbac4d16d35a6056d0.tar.gz plan9port-0cd1385d9f8a151fa1e42dfbac4d16d35a6056d0.tar.bz2 plan9port-0cd1385d9f8a151fa1e42dfbac4d16d35a6056d0.zip |
acme: fix directory resize bug
Diffstat (limited to 'src/cmd')
-rw-r--r-- | src/cmd/acme/text.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/cmd/acme/text.c b/src/cmd/acme/text.c index f972b6ab..1a6c09e4 100644 --- a/src/cmd/acme/text.c +++ b/src/cmd/acme/text.c @@ -71,17 +71,20 @@ textredraw(Text *t, Rectangle r, Font *f, Image *b, int odx) int textresize(Text *t, Rectangle r, int keepextra) { + int odx; + if(Dy(r) <= 0) r.max.y = r.min.y; if(!keepextra) r.max.y -= Dy(r)%t->fr.font->height; + odx = Dx(t->all); t->all = r; t->scrollr = r; t->scrollr.max.x = r.min.x+Scrollwid; t->lastsr = nullrect; r.min.x += Scrollwid+Scrollgap; frclear(&t->fr, 0); - textredraw(t, r, t->fr.font, screen, Dx(t->all)); + textredraw(t, r, t->fr.font, screen, odx); if(keepextra && t->fr.r.max.y < t->all.max.y){ r.min.x -= Scrollgap; r.min.y = t->fr.r.max.y; |