diff --git a/src/Magnum/Math/Range.h b/src/Magnum/Math/Range.h index baaabf432..52c7c3c7e 100644 --- a/src/Magnum/Math/Range.h +++ b/src/Magnum/Math/Range.h @@ -204,7 +204,9 @@ template class Range { * remains the same. * @see @ref padded() */ - Range translated(const VectorType& vector) const; + Range translated(const VectorType& vector) const { + return {_min + vector, _max + vector}; + } /** * @brief Padded rage @@ -213,7 +215,9 @@ template class Range { * Center remains the same. * @see @ref translated(), @ref fromCenter() */ - Range padded(const VectorType& padding) const; + Range padded(const VectorType& padding) const { + return {_min - padding, _max + padding}; + } /** * @brief Scaled range @@ -221,7 +225,9 @@ template class Range { * Multiplies the minimal and maximal coordinates by given amount. * @see @ref padded() */ - Range scaled(const VectorType& scaling) const; + Range scaled(const VectorType& scaling) const { + return {_min*scaling, _max*scaling}; + } /** * @brief Whether given point is contained inside the range @@ -702,18 +708,6 @@ extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utili extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Range<3, Double>&); #endif -template Range Range::translated(const VectorType& vector) const { - return {_min + vector, _max + vector}; -} - -template Range Range::padded(const VectorType& padding) const { - return {_min - padding, _max + padding}; -} - -template Range Range::scaled(const VectorType& scaling) const { - return {_min*scaling, _max*scaling}; -} - }} namespace Corrade { namespace Utility {