looks good, sorry for the delay. On Tue, Aug 24, 2010 at 02:14, <r@golang.org> wrote: > Reviewers: rsc, > >loo > > Please review this at http://codereview.appspot.com/2007045/ > > Affected files: > M src/cmd/acme/rows.c > > > Index: src/cmd/acme/rows.c > =================================================================== > --- a/src/cmd/acme/rows.c > +++ b/src/cmd/acme/rows.c > @@ -102,12 +102,14 @@ > void > rowresize(Row *row, Rectangle r) > { > - int i, dx, odx; > - Rectangle r1, r2; > + int i, dx, odx, deltax; > + Rectangle or, r1, r2; > Column *c; > > dx = Dx(r); > odx = Dx(row->r); > + or = row->r; > + deltax = r.min.x - or.min.x; > row->r = r; > r1 = r; > r1.max.y = r1.min.y + font->height; > @@ -121,10 +123,11 @@ > for(i=0; i<row->ncol; i++){ > c = row->col[i]; > r1.min.x = r1.max.x; > + /* the test should not be necessary, but guarantee we don't > lose a pixel */ > if(i == row->ncol-1) > r1.max.x = r.max.x; > else > - r1.max.x = r1.min.x+Dx(c->r)*dx/odx; > + r1.max.x = (c->r.max.x-or.min.x)*Dx(r)/Dx(or) + > deltax; > if(i > 0){ > r2 = r1; > r2.max.x = r2.min.x+Border; > > >
*** Submitted as b833c11f9a03 *** acme: fix rounding in rows computation R=rsc CC=codebot http://codereview.appspot.com/2007045 Committer: Russ Cox <rsc@swtch.com>