-//
-// 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/roll-layout.h>
+// EXTERNAL INCLUDES
#include <algorithm>
-
-#include <dali-toolkit/public-api/controls/scrollable/item-view/roll-layout.h>
+#include <dali/public-api/animation/animation.h>
using namespace Dali;
using namespace Dali::Toolkit;
-using namespace std;
namespace // unnamed namespace
{
}
else
{
- float yStep = max(50.0f, min(itemSize.y, scrollSpeedFactor));
+ float yStep = std::max(50.0f, std::min(itemSize.y, scrollSpeedFactor));
y = adjustedLayoutPosition < Math::MACHINE_EPSILON_0 ? adjustedLayoutPosition * yStep : (layoutSize.height * 0.5f + adjustedRowSpacing) + (adjustedLayoutPosition - 1.0f) * yStep;
y += itemSize.y * 0.5f - layoutSize.height * 0.5f;
}
float z = adjustedLayoutPosition * (10.0f + scrollSpeedFactor);
- z -= min(3000.0f, scrollSpeedFactor * 2.0f);
+ z -= std::min(3000.0f, scrollSpeedFactor * 2.0f);
return Vector3(itemSize.x * 0.5f - layoutSize.x * 0.5f, y, z);
}
}
else
{
- float xStep = max(50.0f, min(itemSize.y, scrollSpeedFactor));
+ float xStep = std::max(50.0f, std::min(itemSize.y, scrollSpeedFactor));
x = adjustedLayoutPosition < Math::MACHINE_EPSILON_0 ? adjustedLayoutPosition * xStep : (layoutSize.width * 0.5f + adjustedRowSpacing) + (adjustedLayoutPosition - 1.0f) * xStep;
x += itemSize.y * 0.5f - layoutSize.width * 0.5f;
}
float z = adjustedLayoutPosition * (10.0f + scrollSpeedFactor);
- z -= min(3000.0f, scrollSpeedFactor * 2.0f);
+ z -= std::min(3000.0f, scrollSpeedFactor * 2.0f);
return Vector3(x, itemSize.x * 0.5f - layoutSize.y * 0.5f, z);
}
}
else
{
- float yStep = max(50.0f, min(itemSize.y, scrollSpeedFactor));
+ float yStep = std::max(50.0f, std::min(itemSize.y, scrollSpeedFactor));
y = adjustedLayoutPosition < Math::MACHINE_EPSILON_0 ? adjustedLayoutPosition * yStep : (layoutSize.height * 0.5f + adjustedRowSpacing) + (adjustedLayoutPosition - 1.0f) * yStep;
y += itemSize.y * 0.5f - layoutSize.height * 0.5f;
}
float z = adjustedLayoutPosition * (10.0f + scrollSpeedFactor);
- z -= min(3000.0f, scrollSpeedFactor * 2.0f);
+ z -= std::min(3000.0f, scrollSpeedFactor * 2.0f);
return Vector3(-(itemSize.x * 0.5f - layoutSize.x * 0.5f),
}
else
{
- float xStep = max(50.0f, min(itemSize.y, scrollSpeedFactor));
+ float xStep = std::max(50.0f, std::min(itemSize.y, scrollSpeedFactor));
x = adjustedLayoutPosition < Math::MACHINE_EPSILON_0 ? adjustedLayoutPosition * xStep : (layoutSize.width * 0.5f + adjustedRowSpacing) + (adjustedLayoutPosition - 1.0f) * xStep;
x += itemSize.y * 0.5f - layoutSize.width * 0.5f;
}
float z = adjustedLayoutPosition * (10.0f + scrollSpeedFactor);
- z -= min(3000.0f, scrollSpeedFactor * 2.0f);
+ z -= std::min(3000.0f, scrollSpeedFactor * 2.0f);
return Vector3(-x,
itemSize.x * 0.5f - layoutSize.y * 0.5f,
factor = adjustedLayoutPosition - 1.0f;
}
- float scale = min(1.0f, max(0.1f, 1.0f - 0.1f * factor));
+ float scale = std::min(1.0f, std::max(0.1f, 1.0f - 0.1f * factor));
if(scrollSpeed > 0.0f)
{
- scale *= min(1.0f, max(0.1f, 1.0f / (scrollSpeed * 0.05f)));
+ scale *= std::min(1.0f, std::max(0.1f, 1.0f / (scrollSpeed * 0.05f)));
}
return Vector3(scale, scale, scale);
factor = adjustedLayoutPosition - 1.0f;
}
- float darkness = min(1.0f, max(0.5f, 1.0f - 0.5f * factor));
- float alpha = min(1.0f, max(0.0f, 1.0f - 0.9f * factor));
+ float darkness = std::min(1.0f, std::max(0.5f, 1.0f - 0.5f * factor));
+ float alpha = std::min(1.0f, std::max(0.0f, 1.0f - 0.9f * factor));
return Vector4(darkness, darkness, darkness, alpha);
}
};