${public_api_src_dir}/math/matrix.cpp
${public_api_src_dir}/math/matrix3.cpp
${public_api_src_dir}/math/quaternion.cpp
+ ${public_api_src_dir}/math/rect.cpp
${public_api_src_dir}/math/vector2.cpp
${public_api_src_dir}/math/vector3.cpp
${public_api_src_dir}/math/vector4.cpp
--- /dev/null
+/*
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// CLASS HEADER
+#include <dali/public-api/math/rect.h>
+
+namespace Dali
+{
+// Ensure Rect is maintained as a trivially copyable type
+static_assert(std::is_trivially_copyable<Rect<float>>::value);
+} // namespace Dali
+
* @brief Template class to create and operate on rectangles.
* @SINCE_1_0.0
*/
-
template< typename T = float >
struct Rect
{
}
/**
- * @brief Copy constructor.
+ * @brief Default copy constructor.
*
- * @SINCE_1_0.0
+ * @SINCE_1_9.27
* @param[in] rhs The original object
*/
- Rect(const Rect<T>& rhs)
- {
- x = rhs.x;
- y = rhs.y;
- width = rhs.width;
- height = rhs.height;
- }
+ Rect( const Rect<T>& rhs ) = default;
/**
- * @brief Copy assignment operator.
+ * @brief Default copy assignment operator.
*
- * @SINCE_1_0.0
+ * @SINCE_1_9.27
* @param[in] rhs The original object
* @return Reference to this
*/
- Rect<T>& operator= (const Rect<T>& rhs)
- {
- if (this != &rhs)
- {
- x = rhs.x;
- y = rhs.y;
- width = rhs.width;
- height = rhs.height;
- }
-
- return *this;
- }
+ Rect<T>& operator=( const Rect<T>& rhs ) = default;
/**
- * @brief Move constructor.
+ * @brief Default move constructor.
*
- * @SINCE_1_9.21
+ * @SINCE_1_9.27
* @param[in] rhs The original object
*/
- Rect<T>( Rect<T>&& rhs )
- : x( rhs.x ),
- y( rhs.y ),
- width( rhs.width ),
- height( rhs.height )
- {
- }
+ Rect<T>( Rect<T>&& rhs ) = default;
/**
- * @brief Move assignment operator.
+ * @brief Default move assignment operator.
*
- * @SINCE_1_9.21
+ * @SINCE_1_9.27
* @param[in] rhs The original object
* @return Reference to this
*/
- Rect<T>& operator=( Rect<T>&& rhs )
- {
- if (this != &rhs)
- {
- x = rhs.x;
- y = rhs.y;
- width = rhs.width;
- height = rhs.height;
- }
-
- return *this;
- }
+ Rect<T>& operator=( Rect<T>&& rhs ) = default;
/**
* @brief Assignment operator.
* @param[in] vec4 The Vector4 to assign
* @return Reference to this
*/
- Rect<T>& operator= (const Vector4& vec4)
+ Rect<T>& operator=(const Vector4& vec4)
{
x = vec4.x;
y = vec4.y;