aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/acme
diff options
context:
space:
mode:
authorPetter Rodhelind <petter.rodhelind@gmail.com>2020-05-06 20:13:52 +0200
committerPetter Rodhelind <petter.rodhelind@gmail.com>2020-05-06 20:13:52 +0200
commitea23656f7c3afcfd8516b00c0db09879ae80a09f (patch)
tree5fc057fb21b7efb41c096148da7023ca9ed10e3d /src/cmd/acme
parent9c79e48c93c0c4d14aabcb490fab048d68934cb2 (diff)
parentacffdcb6eed3385e1566c0ac86fb6b4bc130664b (diff)
downloadplan9port-ea23656f7c3afcfd8516b00c0db09879ae80a09f.tar.gz
plan9port-ea23656f7c3afcfd8516b00c0db09879ae80a09f.tar.bz2
plan9port-ea23656f7c3afcfd8516b00c0db09879ae80a09f.zip
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'src/cmd/acme')
-rw-r--r--src/cmd/acme/cols.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/cmd/acme/cols.c b/src/cmd/acme/cols.c
index 63c33ac1..63247a84 100644
--- a/src/cmd/acme/cols.c
+++ b/src/cmd/acme/cols.c
@@ -232,7 +232,7 @@ colmousebut(Column *c)
void
colresize(Column *c, Rectangle r)
{
- int i;
+ int i, old, new;
Rectangle r1, r2;
Window *w;
@@ -245,6 +245,8 @@ colresize(Column *c, Rectangle r)
r1.max.y += Border;
draw(screen, r1, display->black, nil, ZP);
r1.max.y = r.max.y;
+ new = Dy(r) - c->nw*(Border + font->height);
+ old = Dy(c->r) - c->nw*(Border + font->height);
for(i=0; i<c->nw; i++){
w = c->w[i];
w->maxlines = 0;
@@ -252,8 +254,8 @@ colresize(Column *c, Rectangle r)
r1.max.y = r.max.y;
else{
r1.max.y = r1.min.y;
- if(Dy(c->r) != 0){
- r1.max.y += (Dy(w->r)+Border)*Dy(r)/Dy(c->r);
+ if(new > 0 && old > 0 && Dy(w->r) > Border+font->height){
+ r1.max.y += (Dy(w->r)-Border-font->height)*new/old + Border + font->height;
}
}
r1.max.y = max(r1.max.y, r1.min.y + Border+font->height);