- /**
- * @param[in] contentSize The size of scrollable content
- */
- IndicatorSizeConstraint(float contentSize)
- : mContentSize(contentSize)
- {
- }
-
- /**
- * Constraint operator
- * @param[in] current The current indicator size
- * @param[in] parentSizeProperty The parent size of scroll indicator.
- * @return The new scroll indicator size.
- */
- Vector3 operator()(const Vector3& current,
- const PropertyInput& parentSizeProperty)
- {
- const Vector3& parentSize = parentSizeProperty.GetVector3();
- float height = mContentSize > parentSize.height ? parentSize.height * ( parentSize.height / mContentSize ) : parentSize.height * ( (parentSize.height - mContentSize * 0.5f) / parentSize.height);
- return Vector3( parentSize.width, std::max(MINIMUM_INDICATOR_HEIGHT, height), parentSize.depth );
- }
-
- float mContentSize; ///< The size of scrollable content
-};
+ float height = contentSize > parentSize.height ?
+ parentSize.height * ( parentSize.height / contentSize ) :
+ parentSize.height * ( (parentSize.height - contentSize * 0.5f) / parentSize.height);
+ return Vector3( parentSize.width, std::max(MINIMUM_INDICATOR_HEIGHT, height), parentSize.depth );
+}