+ mOvershootOverlay.SetVisible(visible);
+ // make sure overshoot image is correctly placed
+ if( visible )
+ {
+ Actor self = mAttachedScrollView.Self();
+ if(mOvershoot > 0.0f)
+ {
+ // positive overshoot
+ const Vector3 size = mOvershootOverlay.GetCurrentSize();
+ Vector3 relativeOffset;
+ const Vector3 parentSize = self.GetCurrentSize();
+ if(IsVertical())
+ {
+ mOvershootOverlay.SetOrientation( Quaternion( Radian( 0.0f ), Vector3::ZAXIS ) );
+ mOvershootOverlay.SetSize(parentSize.width, GetBounceActorHeight(parentSize.width, mOvershootSize.height), size.depth);
+ }
+ else
+ {
+ mOvershootOverlay.SetOrientation( Quaternion( Radian( 1.5f * Math::PI ), Vector3::ZAXIS ) );
+ mOvershootOverlay.SetSize(parentSize.height, GetBounceActorHeight(parentSize.height, mOvershootSize.height), size.depth);
+ relativeOffset = Vector3(0.0f, 1.0f, 0.0f);
+ }
+ mOvershootOverlay.SetPosition(relativeOffset * parentSize);
+ }
+ else
+ {
+ // negative overshoot
+ const Vector3 size = mOvershootOverlay.GetCurrentSize();
+ Vector3 relativeOffset;
+ const Vector3 parentSize = self.GetCurrentSize();
+ if(IsVertical())
+ {
+ mOvershootOverlay.SetOrientation( Quaternion( Radian( Math::PI ), Vector3::ZAXIS ) );
+ mOvershootOverlay.SetSize(parentSize.width, GetBounceActorHeight(parentSize.width, mOvershootSize.height), size.depth);
+ relativeOffset = Vector3(1.0f, 1.0f, 0.0f);
+ }
+ else
+ {
+ mOvershootOverlay.SetOrientation( Quaternion( Radian( 0.5f * Math::PI ), Vector3::ZAXIS ) );
+ mOvershootOverlay.SetSize(parentSize.height, GetBounceActorHeight(parentSize.height, mOvershootSize.height), size.depth);
+ relativeOffset = Vector3(1.0f, 0.0f, 0.0f);
+ }
+ mOvershootOverlay.SetPosition(relativeOffset * parentSize);
+ }
+ }