diff options
author | Russ Cox <rsc@swtch.com> | 2012-11-25 22:15:57 -0500 |
---|---|---|
committer | Russ Cox <rsc@swtch.com> | 2012-11-25 22:15:57 -0500 |
commit | 9f3851871ed6edb544dfe5b518bff0121d6c020b (patch) | |
tree | 086485c69525c1923fc55f65a93605bd14e85f38 /src/libdraw | |
parent | 323e7d0193999a22e605786d06fcff76cb780e38 (diff) | |
download | plan9port-9f3851871ed6edb544dfe5b518bff0121d6c020b.tar.gz plan9port-9f3851871ed6edb544dfe5b518bff0121d6c020b.tar.bz2 plan9port-9f3851871ed6edb544dfe5b518bff0121d6c020b.zip |
libdraw: add scalesize
R=rsc
http://codereview.appspot.com/6855092
Diffstat (limited to 'src/libdraw')
-rw-r--r-- | src/libdraw/init.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/libdraw/init.c b/src/libdraw/init.c index c698ec68..b2df7fd7 100644 --- a/src/libdraw/init.c +++ b/src/libdraw/init.c @@ -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; +} |