Remove obsolete and non functional SizeChanged signal from actor
[platform/core/uifw/dali-toolkit.git] / base / dali-toolkit / internal / controls / scrollable / scroll-view / scroll-view-helper-functions.cpp
1 /*
2  * Copyright (c) 2014 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17
18 // HEADER
19 #include <dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-helper-functions.h>
20
21 // EXTERNAL INCLUDES
22 #include <dali/public-api/math/math-utils.h>
23
24 namespace Dali
25 {
26
27 namespace Toolkit
28 {
29
30 namespace Internal
31 {
32
33 namespace ScrollViewHelperFunctions
34 {
35
36 bool IsStraightOnView( const Vector3& position )
37 {
38   return ( fabsf(position.x) < Math::MACHINE_EPSILON_1 ) && ( fabsf( position.y ) < Math::MACHINE_EPSILON_1 );
39 }
40
41 void WrapPositionWithinDomain( Vector3& position, const Vector3& pageSize, const Vector3& min, const Vector3& max )
42 {
43   if( fabsf( min.x - max.x ) > Math::MACHINE_EPSILON_1 )
44   {
45     // WRAP X (based on the position of the right side)
46     position.x = WrapInDomain( position.x + pageSize.width, min.x, max.x ) - pageSize.width;
47   }
48
49   if( fabsf( min.y - max.y ) > Math::MACHINE_EPSILON_1 )
50   {
51     // WRAP Y (based on the position of the bottom side)
52     position.y = WrapInDomain( position.y + pageSize.height, min.y, max.y ) - pageSize.height;
53   }
54 }
55
56 bool IsOutsideView( const Vector3& position, const Vector3& pageSize )
57 {
58   return ( fabsf( position.x ) >= pageSize.width ) || ( fabsf( position.y ) >= pageSize.height );
59 }
60
61 } // namespace ScrollViewHelperFunctions
62
63 } // namespace Internal
64
65 } // namespace Toolkit
66
67 } // namespace Dali