Skip to content

Commit

Permalink
start on issue #10 and #16
Browse files Browse the repository at this point in the history
  • Loading branch information
ircwaves committed Mar 20, 2019
1 parent 50cb5c8 commit ef9e1f4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions GIP/gip/geometry.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ namespace gip {
Rect() : _p0(0,0), _p1(-1,-1), _padding(0) {}
//! Constructor takes in top left coordinate and width/height
Rect(T x, T y, T width, T height)
: _p0(x,y), _p1(x+width-1,y+height-1), _padding(0) {
: _p0(x,y), _p1(x+width,y+height), _padding(0) {
// Validate, x0 and y0 should always be the min values
/*if (_width < 0) {
_width = abs(m_width);
Expand Down Expand Up @@ -113,9 +113,9 @@ namespace gip {
//! Area of the Rect
T area() const { return abs(width()*height()); }
//! Width of Rect
T width() const { return _p1.x()-_p0.x()+1; }
T width() const { return _p1.x()-_p0.x(); }
//! Height of Rect
T height() const { return _p1.y()-_p0.y()+1; }
T height() const { return _p1.y()-_p0.y(); }
//! Left x coordinate
T x0() const { return _p0.x(); }
//! Top y coordinate
Expand Down

0 comments on commit ef9e1f4

Please sign in to comment.