summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-10-15 14:22:11 +0100
committerCarl Hetherington <cth@carlh.net>2013-10-15 14:22:11 +0100
commit573d38b0d1122597a73be47401e8b908429b9fe4 (patch)
tree5b6aeaae9f7928aa8b8aee5ae8b1c75bf391815f /src
parent647a861e1fd65f6ddb30fda353cd1b4bbb334dc1 (diff)
Add ratio() method.
Diffstat (limited to 'src')
-rw-r--r--src/util.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/util.h b/src/util.h
index 4f590198..2f661d77 100644
--- a/src/util.h
+++ b/src/util.h
@@ -54,6 +54,10 @@ struct Size {
: width (w)
, height (h)
{}
+
+ float ratio () const {
+ return float (width) / height;
+ }
int width;
int height;