tacme: fix directory resize bug - plan9port - [fork] Plan 9 from user space
HTML git clone git://src.adamsgaard.dk/plan9port
DIR Log
DIR Files
DIR Refs
DIR README
DIR LICENSE
---
DIR commit 0cd1385d9f8a151fa1e42dfbac4d16d35a6056d0
DIR parent 5e22f11b97dc97ca6dd449d4efec1838c996cb0c
HTML Author: Russ Cox <rsc@swtch.com>
Date: Fri, 7 Mar 2008 07:47:54 -0500
acme: fix directory resize bug
Diffstat:
M src/cmd/acme/text.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
---
DIR diff --git a/src/cmd/acme/text.c b/src/cmd/acme/text.c
t@@ -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;