From bc63e3993146b202fd9dd2ce53ae2abe7dec696e Mon Sep 17 00:00:00 2001 From: Pharap <2933055+Pharap@users.noreply.github.com> Date: Tue, 10 Jul 2018 16:24:18 +0100 Subject: [PATCH] Add constructors to Rect --- src/Arduboy2.cpp | 9 +++++++++ src/Arduboy2.h | 4 ++++ 2 files changed, 13 insertions(+) diff --git a/src/Arduboy2.cpp b/src/Arduboy2.cpp index 5d59b55..40869e7 100644 --- a/src/Arduboy2.cpp +++ b/src/Arduboy2.cpp @@ -8,6 +8,15 @@ #include "ab_logo.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 ========== //======================================== diff --git a/src/Arduboy2.h b/src/Arduboy2.h index a445059..56b2fcc 100644 --- a/src/Arduboy2.h +++ b/src/Arduboy2.h @@ -103,6 +103,10 @@ struct Rect int16_t y; /**< The Y coordinate of the top left corner */ uint8_t width; /**< The width 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