diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2014-11-24 13:30:58 +0200 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2015-04-29 07:22:21 -0400 |
commit | 38728f0835ddef45bc321ccdb98d2e57d4781725 (patch) | |
tree | ceddd8fce7d4c15afdaa8007b88ea2fa6bb1af92 | |
parent | 59ce8663f9a20f8bd7a16620b8bccaa23357be36 (diff) |
correct implementation for Rectangle::vertical_fraction()
-rw-r--r-- | libs/canvas/rectangle.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libs/canvas/rectangle.cc b/libs/canvas/rectangle.cc index 4bb21c42e6..cdc8d226e5 100644 --- a/libs/canvas/rectangle.cc +++ b/libs/canvas/rectangle.cc @@ -284,5 +284,8 @@ Rectangle::vertical_fraction (double y) const return 0; } - return (i.y - bbox.y0) / bbox.height(); + /* convert to fit Cairo origin model (origin at upper left) + */ + + return 1.0 - ((i.y - bbox.y0) / bbox.height()); } |