acme: do not redraw body on every tag change
fixes #5 http://bitbucket.org/rsc/plan9port/issue/5/ http://groups.google.com/group/plan9port-dev/t/e679347ecaa05cff http://codereview.appspot.com/95041
This commit is contained in:
parent
e6c837d612
commit
cb92a1b41c
2 changed files with 4 additions and 3 deletions
|
|
@ -46,7 +46,8 @@ textredraw(Text *t, Rectangle r, Font *f, Image *b, int odx)
|
||||||
frinit(&t->fr, r, f, b, t->fr.cols);
|
frinit(&t->fr, r, f, b, t->fr.cols);
|
||||||
rr = t->fr.r;
|
rr = t->fr.r;
|
||||||
rr.min.x -= Scrollwid+Scrollgap; /* back fill to scroll bar */
|
rr.min.x -= Scrollwid+Scrollgap; /* back fill to scroll bar */
|
||||||
draw(t->fr.b, rr, t->fr.cols[BACK], nil, ZP);
|
if(!t->fr.noredraw)
|
||||||
|
draw(t->fr.b, rr, t->fr.cols[BACK], nil, ZP);
|
||||||
/* use no wider than 3-space tabs in a directory */
|
/* use no wider than 3-space tabs in a directory */
|
||||||
maxt = maxtab;
|
maxt = maxtab;
|
||||||
if(t->what == Body){
|
if(t->what == Body){
|
||||||
|
|
@ -85,7 +86,7 @@ textresize(Text *t, Rectangle r, int keepextra)
|
||||||
r.min.x += Scrollwid+Scrollgap;
|
r.min.x += Scrollwid+Scrollgap;
|
||||||
frclear(&t->fr, 0);
|
frclear(&t->fr, 0);
|
||||||
textredraw(t, r, t->fr.font, t->fr.b, odx);
|
textredraw(t, r, t->fr.font, t->fr.b, odx);
|
||||||
if(keepextra && t->fr.r.max.y < t->all.max.y){
|
if(keepextra && t->fr.r.max.y < t->all.max.y && !t->fr.noredraw){
|
||||||
/* draw background in bottom fringe of window */
|
/* draw background in bottom fringe of window */
|
||||||
r.min.x -= Scrollgap;
|
r.min.x -= Scrollgap;
|
||||||
r.min.y = t->fr.r.max.y;
|
r.min.y = t->fr.r.max.y;
|
||||||
|
|
|
||||||
|
|
@ -190,7 +190,7 @@ winresize(Window *w, Rectangle r, int safe, int keepextra)
|
||||||
/* If needed, resize & redraw body. */
|
/* If needed, resize & redraw body. */
|
||||||
r1 = r;
|
r1 = r;
|
||||||
r1.min.y = y;
|
r1.min.y = y;
|
||||||
if(tagresized || !safe || !eqrect(w->body.all, r1)){
|
if(!safe || !eqrect(w->body.all, r1)){
|
||||||
oy = y;
|
oy = y;
|
||||||
if(y+1+w->body.fr.font->height <= r.max.y){ /* room for one line */
|
if(y+1+w->body.fr.font->height <= r.max.y){ /* room for one line */
|
||||||
r1.min.y = y;
|
r1.min.y = y;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue