aboutsummaryrefslogtreecommitdiff
path: root/src/libdraw
diff options
context:
space:
mode:
authorRuss Cox <rsc@swtch.com>2012-11-25 22:15:57 -0500
committerRuss Cox <rsc@swtch.com>2012-11-25 22:15:57 -0500
commit9f3851871ed6edb544dfe5b518bff0121d6c020b (patch)
tree086485c69525c1923fc55f65a93605bd14e85f38 /src/libdraw
parent323e7d0193999a22e605786d06fcff76cb780e38 (diff)
downloadplan9port-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.c7
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;
+}