diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2014-11-24 13:09:09 +0200 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2015-04-29 07:22:05 -0400 |
commit | 59ce8663f9a20f8bd7a16620b8bccaa23357be36 (patch) | |
tree | 40914fea1a3ac744d1da3590914627785d5cfd85 /libs/canvas/canvas/rectangle.h | |
parent | 6e335ca5d90ddc62b0af9a60a6b156ed74ac8eb1 (diff) |
add Rectangle::vertical_fraction() as a convenience method
Conflicts:
libs/canvas/rectangle.cc
Diffstat (limited to 'libs/canvas/canvas/rectangle.h')
-rw-r--r-- | libs/canvas/canvas/rectangle.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/libs/canvas/canvas/rectangle.h b/libs/canvas/canvas/rectangle.h index 5df10fbc60..b979a24430 100644 --- a/libs/canvas/canvas/rectangle.h +++ b/libs/canvas/canvas/rectangle.h @@ -64,6 +64,17 @@ public: void set_x1 (Coord); void set_y1 (Coord); + /** return @param y as a floating point fraction of the overall + * height of the rectangle. @param y is in canvas coordinate space. + * + * A value of zero indicates that y is at the bottom of the + * rectangle; a value of 1 indicates that y is at the top. + * + * Will return zero if there is no bounding box or if y + * is outside the bounding box. + */ + double vertical_fraction (double y) const; + enum What { NOTHING = 0x0, LEFT = 0x1, |