summaryrefslogtreecommitdiffstats
path: root/src/cmd/acme/wind.c
diff options
context:
space:
mode:
authorRuss Cox <rsc@swtch.com>2008-03-07 12:51:41 -0500
committerRuss Cox <rsc@swtch.com>2008-03-07 12:51:41 -0500
commit41636940514d72e2a941f55f28dc07685e74b3b4 (patch)
tree10f01f096172ad6f46fa9e5f18a3dfee5a1da4aa /src/cmd/acme/wind.c
parenta2db69c8bda889f30ea38dae5473689cde108458 (diff)
downloadplan9port-41636940514d72e2a941f55f28dc07685e74b3b4.tar.gz
plan9port-41636940514d72e2a941f55f28dc07685e74b3b4.zip
acme: multiline tag fixes
Diffstat (limited to 'src/cmd/acme/wind.c')
-rw-r--r--src/cmd/acme/wind.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/cmd/acme/wind.c b/src/cmd/acme/wind.c
index afd21afc..70a4edec 100644
--- a/src/cmd/acme/wind.c
+++ b/src/cmd/acme/wind.c
@@ -142,17 +142,19 @@ wintaglines(Window *w, Rectangle r)
int
winresize(Window *w, Rectangle r, int safe, int keepextra)
{
- int oy, y, mouseintag, tagresized;
+ int oy, y, mouseintag, mouseinbody, tagresized;
Point p;
Rectangle r1;
+ mouseintag = ptinrect(mouse->xy, w->tag.all);
+ mouseinbody = ptinrect(mouse->xy, w->body.all);
+
/* tagtop is first line of tag */
w->tagtop = r;
w->tagtop.max.y = r.min.y+font->height;
r1 = r;
r1.max.y = min(r.max.y, r1.min.y + w->taglines*font->height);
- mouseintag = ptinrect(mouse->xy, w->tag.all);
/* If needed, recompute number of lines in tag. */
if(!safe || !w->tagsafe || !eqrect(w->tag.all, r1)){
@@ -178,7 +180,7 @@ winresize(Window *w, Rectangle r, int safe, int keepextra)
}
/* If mouse is in body, push down as tag expands. */
- if(!mouseintag && ptinrect(mouse->xy, w->tag.all)){
+ if(mouseinbody && ptinrect(mouse->xy, w->tag.all)){
p = mouse->xy;
p.y = w->tag.all.max.y+3;
moveto(mousectl, p);