Add constructors to Rect

This commit is contained in:
Pharap 2018-07-10 16:24:18 +01:00 committed by GitHub
parent 0eae58c760
commit 2f851f8784
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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

@ -104,6 +104,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 of the point */
Rect(int16_t x, int16_t y, uint8_t width, uint8_t height); /**< The fully initialising constructor of the point */
}; };
/** \brief /** \brief