return PlaceholderHandler::GetPlaceholderTextFontSlant(*this);
}
+void Controller::SetFontSizeScale( float scale )
+{
+ mImpl->mFontSizeScale = scale;
+
+ if( mImpl->mEventData )
+ {
+ // Update the cursor position if it's in editing mode
+ if( EventData::IsEditingState( mImpl->mEventData->mState ) )
+ {
+ mImpl->mEventData->mDecoratorUpdated = true;
+ mImpl->mEventData->mUpdateCursorPosition = true; // Cursor position should be updated when the font size is updated.
+ }
+ }
+
+ // Clear the font-specific data
+ ClearFontData();
+
+ mImpl->RequestRelayout();
+}
+
+float Controller::GetFontSizeScale() const
+{
+ if( nullptr != mImpl->mFontDefaults )
+ {
+ return mImpl->mFontSizeScale;
+ }
+
+ return 1.f;
+}
+
void Controller::SetDefaultFontSize( float fontSize, FontSizeType type )
{
if( NULL == mImpl->mFontDefaults )
return mImpl->GetTextSelectionRange();
}
+CharacterIndex Controller::GetPrimaryCursorPosition() const
+{
+ return mImpl->GetPrimaryCursorPosition();
+}
+
+bool Controller::SetPrimaryCursorPosition( CharacterIndex index )
+{
+ if( mImpl->mEventData )
+ {
+ mImpl->mEventData->mCheckScrollAmount = true;
+ mImpl->mEventData->mIsLeftHandleSelected = true;
+ mImpl->mEventData->mIsRightHandleSelected = true;
+ mImpl->mEventData->mCheckScrollAmount = true;
+ if( mImpl->SetPrimaryCursorPosition(index) )
+ {
+ KeyboardFocusGainEvent();
+ return true;
+ }
+ }
+ return false;
+}
+
void Controller::SelectWholeText()
{
SelectEvent( 0.f, 0.f, SelectionType::ALL );
if( addFontSizeRun )
{
- fontDescriptionRun.size = static_cast<PointSize26Dot6>( mImpl->mEventData->mInputStyle.size * 64.f );
+ fontDescriptionRun.size = static_cast<PointSize26Dot6>( mImpl->mEventData->mInputStyle.size * mImpl->mFontSizeScale * 64.f );
fontDescriptionRun.sizeDefined = true;
}