From 573d38b0d1122597a73be47401e8b908429b9fe4 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Tue, 15 Oct 2013 14:22:11 +0100 Subject: [PATCH] Add ratio() method. --- src/util.h | 4 ++++ 1 file changed, 4 insertions(+) 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; -- 2.30.2