diff --git a/src/geometry.h b/src/geometry.h index 91295d6c5..f289dfb30 100644 --- a/src/geometry.h +++ b/src/geometry.h @@ -52,10 +52,18 @@ struct point { /// @brief Point x component /// @return x value of this point - inline T x() const { return value.x(); } + template ::value>> + inline R x() const { + return reinterpret_cast(this->value.x()); + } /// @brief Point y component /// @return y value of this point - inline T y() const { return value.y(); } + template ::value>> + inline R y() const { + return reinterpret_cast(this->value.y()); + } template ::value>> @@ -148,16 +156,32 @@ struct rect { /// @brief Rectangle x position /// @return x position of this rectangle - inline T x() const { return this->pos.x(); } + template ::value>> + inline R x() const { + return reinterpret_cast(this->pos.x()); + } /// @brief Rectangle y position /// @return y position of this rectangle - inline T y() const { return this->pos.y(); } + template ::value>> + inline R y() const { + return reinterpret_cast(this->pos.y()); + } /// @brief Rectangle width /// @return width of this rectangle - inline T width() const { return this->size.x(); } + template ::value>> + inline R width() const { + return reinterpret_cast(this->size.x()); + } /// @brief Rectangle height /// @return height of this rectangle - inline T height() const { return this->size.y(); } + template ::value>> + inline R height() const { + return reinterpret_cast(this->size.y()); + } template ::value>>