Added GetMaxSwingAngle() and GetSwingDropOff.
Change-Id: I65da3c291534bcb6bb84a64f9ca46fdda9e0ca61
}
}
+void ScrollViewTwistEffect::SetMaxSwingAngle(const Vector2& maxSwingAngle)
+{
+ mMaxSwingAngle = maxSwingAngle;
+}
+
+Vector2 ScrollViewTwistEffect::GetMaxSwingAngle() const
+{
+ return mMaxSwingAngle;
+}
+
void ScrollViewTwistEffect::SetSwingDropOff(const Vector2& dropOff, const Vector2& distance, AlphaFunction function)
{
- if( mDropOffDistance.LengthSquared() > Math::MACHINE_EPSILON_1 && mDropOff.LengthSquared() > Math::MACHINE_EPSILON_1 )
+ if( distance.LengthSquared() > Math::MACHINE_EPSILON_1 && dropOff.LengthSquared() > Math::MACHINE_EPSILON_1 )
{
mFlags |= FlagDropOff;
mDropOff = dropOff;
mFlags = mFlags & ~FlagDefaultDropOff;
}
+void ScrollViewTwistEffect::GetSwingDropOff( Vector2& dropOff, Vector2& distance, AlphaFunction& function ) const
+{
+ dropOff = mDropOff;
+ distance = mDropOffDistance;
+ function = mDropOffFunction;
+}
+
void ScrollViewTwistEffect::OnAttach(Toolkit::ScrollView& scrollView)
{
// Create effect-time property if not already created.
/**
* @copydoc Toolkit::ScrollViewEffect::SetMaxSwingAngle
*/
- void SetMaxSwingAngle(const Vector2& maxSwingAngle) { mMaxSwingAngle = maxSwingAngle; }
+ void SetMaxSwingAngle(const Vector2& maxSwingAngle);
+
+ /**
+ * @copydoc Toolkit::ScrollViewEffect::GetMaxSwingAngle
+ */
+ Vector2 GetMaxSwingAngle() const;
/**
* @copydoc Toolkit::ScrollViewEffect::SetSwingDropOff
*/
void SetSwingDropOff(const Vector2& dropOff, const Vector2& distance, AlphaFunction function = NULL);
+ /**
+ * @copydoc Toolkit::ScrollViewEffect::GetSwingDropOff
+ */
+ void GetSwingDropOff( Vector2& dropOff, Vector2& distance, AlphaFunction& function ) const;
+
public:
/**
GetImpl(*this).SetMaxSwingAngle(maxSwingAngle);
}
+Vector2 ScrollViewTwistEffect::GetMaxSwingAngle() const
+{
+ return GetImpl( *this ).GetMaxSwingAngle();
+}
+
void ScrollViewTwistEffect::SetSwingDropOff(const Vector2& dropOff, const Vector2& distance, AlphaFunction function)
{
GetImpl(*this).SetSwingDropOff(dropOff, distance, function);
}
+void ScrollViewTwistEffect::GetSwingDropOff( Vector2& dropOff, Vector2& distance, AlphaFunction& function ) const
+{
+ GetImpl(*this).GetSwingDropOff(dropOff, distance, function);
+}
+
} // namespace Toolkit
} // namespace Dali
void SetMaxSwingAngle(const Vector2& maxSwingAngle);
/**
+ * @brief Retrieve the maximum swing angle when at zero drop off.
+ *
+ * @return The maximum swing angle for x and y axes
+ */
+ Vector2 GetMaxSwingAngle() const;
+
+ /**
* @brief Set the drop off values to affect the amount of swing
* angle applied to an actor the further it is from the scroll
* position.
*/
void SetSwingDropOff(const Vector2& dropOff, const Vector2& distance, AlphaFunction function = NULL);
+ /**
+ * @brief Get the drop off values that affect the amount of swing angle that is applied to an actor.
+ *
+ * @param[out] dropOff The current drop-off amount.
+ * @param[out] distance The current distance to apply drop-off in pixels.
+ * @param[out] function The current alpha function used to affect how the drop iff is applied over the distance.
+ */
+ void GetSwingDropOff( Vector2& dropOff, Vector2& distance, AlphaFunction& function ) const;
+
protected:
/**