END_TEST;
}
+int UtcDaliVector2ConstructorUint16PairP(void)
+{
+ TestApplication application;
+ Uint16Pair pair( 20, 30 );
+ Vector2 vec2(pair);
+ DALI_TEST_EQUALS(vec2.x, 20.0f, 0.001, TEST_LOCATION);
+ DALI_TEST_EQUALS(vec2.y, 30.0f, 0.001, TEST_LOCATION);
+ END_TEST;
+}
+
int UtcDaliVector2CopyConstructor01P(void)
{
TestApplication application;
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * 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.
#include <dali/public-api/common/dali-common.h>
#include <dali/public-api/math/vector3.h>
#include <dali/public-api/math/math-utils.h>
+#include <dali/public-api/math/uint-16-pair.h>
#include <dali/internal/render/common/performance-monitor.h>
namespace Dali
{
}
+Vector2::Vector2(const Uint16Pair& pair)
+: width(pair.GetWidth()),
+ height(pair.GetHeight())
+{
+}
+
Vector2& Vector2::operator=(const Vector3& rhs)
{
x = rhs.x;
#define DALI_VECTOR_2_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * 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.
namespace Dali
{
+
+class Uint16Pair;
+
/**
* @addtogroup dali_core_math
* @{
*/
explicit Vector2(const Vector4& vec4);
+ /**
+ * @brief Conversion constructor from a Uint16Pair.
+ *
+ * @SINCE_1_9.21
+ *
+ * @param[in] pair The Uint16Pair to create this vector from
+ */
+ Vector2(const Uint16Pair& pair);
+
// Constants
static const Vector2 ONE; ///< (1.0f,1.0f)