libdraw: add scalesize

R=rsc
http://codereview.appspot.com/6855092
This commit is contained in:
Russ Cox 2012-11-25 22:15:57 -05:00
parent 323e7d0193
commit 9f3851871e
3 changed files with 24 additions and 0 deletions

View file

@ -428,3 +428,10 @@ bufimage(Display *d, int n)
return p;
}
int
scalesize(Display *d, int n)
{
if(d == nil || d->dpi <= DefaultDPI)
return n;
return (n*d->dpi+DefaultDPI/2)/DefaultDPI;
}