-//
-// Copyright (c) 2014 Samsung Electronics Co., Ltd.
-//
-// Licensed under the Flora License, Version 1.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://floralicense.org/license/
-//
-// 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.
-//
+/*
+ * Copyright (c) 2014 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-toolkit/public-api/controls/scrollable/item-view/spiral-layout.h>
+// EXTERNAL INCLUDES
#include <algorithm>
-
-#include <dali-toolkit/public-api/controls/scrollable/item-view/spiral-layout.h>
+#include <dali/public-api/animation/animation.h>
using namespace Dali;
using namespace Dali::Toolkit;
-using namespace std;
namespace // unnamed namespace
{
{
mImpl->mItemSpacingRadians = itemSpacing;
- float itemsPerSpiral = max(1.0f, (2.0f*(float)Math::PI) / mImpl->mItemSpacingRadians);
+ float itemsPerSpiral = std::max(1.0f, (2.0f*(float)Math::PI) / mImpl->mItemSpacingRadians);
mImpl->mItemDescent = mImpl->mRevolutionDistance / itemsPerSpiral;
}
{
mImpl->mRevolutionDistance = distance;
- float itemsPerSpiral = max(1.0f, (2.0f*(float)Math::PI) / mImpl->mItemSpacingRadians);
+ float itemsPerSpiral = std::max(1.0f, (2.0f*(float)Math::PI) / mImpl->mItemSpacingRadians);
mImpl->mItemDescent = mImpl->mRevolutionDistance / itemsPerSpiral;
}
float layoutHeight = IsHorizontal(mOrientation) ? layoutSize.width : layoutSize.height;
float itemsPerSpiral = layoutHeight / mImpl->mItemDescent;
float itemsCachedBeforeTopItem = layoutHeight * (mImpl->mTopItemAlignment + 0.5f) / mImpl->mItemDescent;
- float itemsViewable = min(itemsPerSpiral, itemsPerSpiral - itemsCachedBeforeTopItem - firstItemPosition + 1.0f);
+ float itemsViewable = std::min(itemsPerSpiral, itemsPerSpiral - itemsCachedBeforeTopItem - firstItemPosition + 1.0f);
- unsigned int firstItem = static_cast<unsigned int>(max(0.0f, -firstItemPosition - itemsCachedBeforeTopItem - 1.0f));
- unsigned int lastItem = static_cast<unsigned int>(max(0.0f, firstItem + itemsViewable));
+ unsigned int firstItem = static_cast<unsigned int>(std::max(0.0f, -firstItemPosition - itemsCachedBeforeTopItem - 1.0f));
+ unsigned int lastItem = static_cast<unsigned int>(std::max(0.0f, firstItem + itemsViewable));
return ItemRange(firstItem, lastItem+1);
}