acme: fix directory resize bug
This commit is contained in:
parent
5e22f11b97
commit
0cd1385d9f
1 changed files with 4 additions and 1 deletions
|
|
@ -71,17 +71,20 @@ textredraw(Text *t, Rectangle r, Font *f, Image *b, int odx)
|
||||||
int
|
int
|
||||||
textresize(Text *t, Rectangle r, int keepextra)
|
textresize(Text *t, Rectangle r, int keepextra)
|
||||||
{
|
{
|
||||||
|
int odx;
|
||||||
|
|
||||||
if(Dy(r) <= 0)
|
if(Dy(r) <= 0)
|
||||||
r.max.y = r.min.y;
|
r.max.y = r.min.y;
|
||||||
if(!keepextra)
|
if(!keepextra)
|
||||||
r.max.y -= Dy(r)%t->fr.font->height;
|
r.max.y -= Dy(r)%t->fr.font->height;
|
||||||
|
odx = Dx(t->all);
|
||||||
t->all = r;
|
t->all = r;
|
||||||
t->scrollr = r;
|
t->scrollr = r;
|
||||||
t->scrollr.max.x = r.min.x+Scrollwid;
|
t->scrollr.max.x = r.min.x+Scrollwid;
|
||||||
t->lastsr = nullrect;
|
t->lastsr = nullrect;
|
||||||
r.min.x += Scrollwid+Scrollgap;
|
r.min.x += Scrollwid+Scrollgap;
|
||||||
frclear(&t->fr, 0);
|
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){
|
if(keepextra && t->fr.r.max.y < t->all.max.y){
|
||||||
r.min.x -= Scrollgap;
|
r.min.x -= Scrollgap;
|
||||||
r.min.y = t->fr.r.max.y;
|
r.min.y = t->fr.r.max.y;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue