Browse Source

Add math::Rect::getLeft/Top().

tags/v2.0.0
Andrew Belt 5 years ago
parent
commit
047e799554
2 changed files with 9 additions and 0 deletions
  1. +3
    -0
      README.md
  2. +6
    -0
      include/math.hpp

+ 3
- 0
README.md View File

@@ -7,3 +7,6 @@
- [Building](https://vcvrack.com/manual/Building.html) - [Building](https://vcvrack.com/manual/Building.html)
- [Communities](https://vcvrack.com/manual/Communities.html) - [Communities](https://vcvrack.com/manual/Communities.html)
- [Licenses](LICENSE.md) - [Licenses](LICENSE.md)

This branch regularly rebases against the `v1` branch.
You may need to `git pull -f` to update your local copy.

+ 6
- 0
include/math.hpp View File

@@ -299,9 +299,15 @@ struct Rect {
bool isEqual(Rect r) const { bool isEqual(Rect r) const {
return pos.isEqual(r.pos) && size.isEqual(r.size); return pos.isEqual(r.pos) && size.isEqual(r.size);
} }
float getLeft() const {
return pos.x;
}
float getRight() const { float getRight() const {
return pos.x + size.x; return pos.x + size.x;
} }
float getTop() const {
return pos.y;
}
float getBottom() const { float getBottom() const {
return pos.y + size.y; return pos.y + size.y;
} }


Loading…
Cancel
Save