libdraw: enter/eenter, set and restore clip rect
parent
aae765a161
commit
f3b08dd655
|
@ -10,7 +10,7 @@ eenter(char *ask, char *buf, int len, Mouse *m)
|
|||
int done, down, tick, n, h, w, l, i;
|
||||
Image *b, *save, *backcol, *bordcol;
|
||||
Point p, o, t;
|
||||
Rectangle r;
|
||||
Rectangle r, sc;
|
||||
Event ev;
|
||||
Rune k;
|
||||
|
||||
|
@ -23,6 +23,9 @@ eenter(char *ask, char *buf, int len, Mouse *m)
|
|||
while(ecankbd())
|
||||
ekbd();
|
||||
|
||||
sc = screen->clipr;
|
||||
replclipr(screen, 0, screen->r);
|
||||
|
||||
if(m) o = m->xy;
|
||||
|
||||
if(buf && len > 0)
|
||||
|
@ -186,6 +189,8 @@ eenter(char *ask, char *buf, int len, Mouse *m)
|
|||
save = nil;
|
||||
}
|
||||
|
||||
replclipr(screen, 0, sc);
|
||||
|
||||
freeimage(backcol);
|
||||
freeimage(bordcol);
|
||||
flushimage(display, 1);
|
||||
|
|
|
@ -11,7 +11,7 @@ enter(char *ask, char *buf, int len, Mousectl *mc, Keyboardctl *kc, Screen *scr)
|
|||
int done, down, tick, n, h, w, l, i;
|
||||
Image *b, *save, *backcol, *bordcol;
|
||||
Point p, o, t;
|
||||
Rectangle r;
|
||||
Rectangle r, sc;
|
||||
Alt a[3];
|
||||
Mouse m;
|
||||
Rune k;
|
||||
|
@ -22,6 +22,9 @@ enter(char *ask, char *buf, int len, Mousectl *mc, Keyboardctl *kc, Screen *scr)
|
|||
if(backcol == nil || bordcol == nil)
|
||||
return -1;
|
||||
|
||||
sc = screen->clipr;
|
||||
replclipr(screen, 0, screen->r);
|
||||
|
||||
n = 0;
|
||||
if(kc){
|
||||
while(nbrecv(kc->c, nil) == 1)
|
||||
|
@ -211,6 +214,8 @@ enter(char *ask, char *buf, int len, Mousectl *mc, Keyboardctl *kc, Screen *scr)
|
|||
}
|
||||
}
|
||||
|
||||
replclipr(screen, 0, sc);
|
||||
|
||||
freeimage(backcol);
|
||||
freeimage(bordcol);
|
||||
flushimage(display, 1);
|
||||
|
|
Loading…
Reference in New Issue