Add constructors to Rect

This commit is contained in:
Pharap 2018-07-10 16:24:18 +01:00 committed by Scott Allen
parent 54d47ec04e
commit bc63e39931
2 changed files with 13 additions and 0 deletions

View File

@ -8,6 +8,15 @@
#include "ab_logo.c" #include "ab_logo.c"
#include "glcdfont.c" #include "glcdfont.c"
//================================
//========== class Rect ==========
//================================
Rect::Rect(int16_t x, int16_t y, uint8_t width, uint8_t height)
: x(x), y(y), width(width), height(height)
{
}
//======================================== //========================================
//========== class Arduboy2Base ========== //========== class Arduboy2Base ==========
//======================================== //========================================

View File

@ -103,6 +103,10 @@ struct Rect
int16_t y; /**< The Y coordinate of the top left corner */ int16_t y; /**< The Y coordinate of the top left corner */
uint8_t width; /**< The width of the rectangle */ uint8_t width; /**< The width of the rectangle */
uint8_t height; /**< The height of the rectangle */ uint8_t height; /**< The height of the rectangle */
Rect() = default; /**< The default constructor */
Rect(int16_t x, int16_t y, uint8_t width, uint8_t height); /**< The fully initialising constructor */
}; };
/** \brief /** \brief