Formatting API
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / public-api / controls / scrollable / scroll-view / scroll-view-constraints.cpp
index ac3b3ed..d5ca6c1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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.
 
 // INTERNAL INCLUDES
 
+#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-constraints.h>
 #include <dali/public-api/common/constants.h>
 #include <dali/public-api/math/math-utils.h>
 #include <dali/public-api/object/property-input.h>
-#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-constraints.h>
 
 using namespace Dali;
 
 namespace Dali
 {
-
 namespace Toolkit
 {
-
-void MoveActorConstraint( Vector3& current, const PropertyInputContainer& inputs )
+void MoveActorConstraint(Vector3& current, const PropertyInputContainer& inputs)
 {
   current += Vector3(inputs[0]->GetVector2());
 }
 
-void WrapActorConstraint( Vector3& position, const PropertyInputContainer& inputs )
+void WrapActorConstraint(Vector3& position, const PropertyInputContainer& inputs)
 {
   bool wrap = inputs[5]->GetBoolean();
 
@@ -45,21 +43,21 @@ void WrapActorConstraint( Vector3& position, const PropertyInputContainer& input
     const Vector2& max = inputs[4]->GetVector2();
 
     const Vector3& anchor = inputs[1]->GetVector3();
-    const Vector3 scale = inputs[0]->GetVector3();
-    const Vector3 size = inputs[2]->GetVector3();
+    const Vector3  scale  = inputs[0]->GetVector3();
+    const Vector3  size   = inputs[2]->GetVector3();
 
     if(fabsf(min.x - max.x) > Math::MACHINE_EPSILON_1)
     {
       // WRAP X (based on the position of the right side)
       float offsetX = (1.0f - anchor.x) * size.x * scale.x;
-      position.x = WrapInDomain(position.x + offsetX, min.x, max.x) - offsetX;
+      position.x    = WrapInDomain(position.x + offsetX, min.x, max.x) - offsetX;
     }
 
     if(fabsf(min.y - max.y) > Math::MACHINE_EPSILON_1)
     {
       // WRAP Y (based on the position of the bottom side)
       float offsetY = (1.0f - anchor.y) * size.y * scale.y;
-      position.y = WrapInDomain(position.y + offsetY, min.y, max.y) - offsetY;
+      position.y    = WrapInDomain(position.y + offsetY, min.y, max.y) - offsetY;
     }
   }
 }
@@ -67,4 +65,3 @@ void WrapActorConstraint( Vector3& position, const PropertyInputContainer& input
 } // namespace Toolkit
 
 } // namespace Dali
-