+void TextEditor::ApplyScrollPosition()
+{
+ const Vector2& scrollOffset = mController->GetTextModel()->GetScrollPosition();
+ float scrollAmount = 0.0f;
+
+ if ( mScrollAnimationEnabled )
+ {
+ scrollAmount = mController->GetScrollAmountByUserInput();
+ }
+ if ( mTextVerticalScroller )
+ {
+ mTextVerticalScroller->CheckStartAnimation( mRenderableActor, scrollOffset.x + mAlignmentOffset, scrollOffset.y - scrollAmount, scrollAmount );
+ }
+ else if ( Equals( scrollAmount, 0.0f, Math::MACHINE_EPSILON_1 ))
+ {
+ mRenderableActor.SetPosition( scrollOffset.x + mAlignmentOffset, scrollOffset.y - scrollAmount );
+ }
+ else
+ {
+ mTextVerticalScroller = Text::TextVerticalScroller::New();
+ if ( !Equals( mScrollAnimationDuration, 0.0f, Math::MACHINE_EPSILON_1 ))
+ {
+ mTextVerticalScroller->SetDuration( mScrollAnimationDuration );
+ }
+ mTextVerticalScroller->CheckStartAnimation( mRenderableActor, scrollOffset.x + mAlignmentOffset, scrollOffset.y - scrollAmount, scrollAmount );
+ }
+}
+