namespace Text
{
+struct Controller::FontDefaults
+{
+ FontDefaults()
+ : mDefaultPointSize(0.0f),
+ mFontId(0u)
+ {
+ }
+
+ FontId GetFontId( TextAbstraction::FontClient& fontClient )
+ {
+ if( !mFontId )
+ {
+ Dali::TextAbstraction::PointSize26Dot6 pointSize = mDefaultPointSize*64;
+ mFontId = fontClient.GetFontId( mDefaultFontFamily, mDefaultFontStyle, pointSize );
+ }
+
+ return mFontId;
+ }
+
+ std::string mDefaultFontFamily;
+ std::string mDefaultFontStyle;
+ float mDefaultPointSize;
+ FontId mFontId;
+};
+
struct Controller::TextInput
{
// Used to queue input events until DoRelayout()
float yPosition = event.p3.mFloat - alignmentOffset.y;
float height(0.0f);
GetClosestCursorPosition( mPrimaryCursorPosition, xPosition, yPosition, height );
- mDecorator->SetPosition( PRIMARY_CURSOR, xPosition, yPosition, height );
+ mDecorator->SetPosition( PRIMARY_CURSOR, xPosition, yPosition, height, height ); // TODO: To be fixed in the next patch.
mUpdateCursorPosition = false;
mDecoratorUpdated = true;
GetClosestCursorPosition( mPrimaryCursorPosition, xPosition, yPosition, height );
- mDecorator->SetPosition( PRIMARY_CURSOR, xPosition, yPosition, height );
+ mDecorator->SetPosition( PRIMARY_CURSOR, xPosition, yPosition, height, height ); // TODO: To be fixed in the next patch.
+
//mDecorator->HidePopup();
ChangeState ( EDITING );
mDecoratorUpdated = true;
// TODO - multi-line selection
const Vector<LineRun>& lines = mVisualModel->mLines;
- float height = lines.Count() ? lines[0].lineSize.height : 0.0f;
+ float height = lines.Count() ? lines[0].ascender + -lines[0].descender : 0.0f;
mDecorator->SetPosition( PRIMARY_SELECTION_HANDLE, primaryX, 0.0f, height );
mDecorator->SetPosition( SECONDARY_SELECTION_HANDLE, secondaryX, 0.0f, height );
const Vector<LineRun>& lines = mVisualModel->mLines;
for( float totalHeight = 0; lineIndex < lines.Count(); ++lineIndex )
{
- totalHeight += lines[lineIndex].lineSize.height;
+ const LineRun& lineRun = lines[lineIndex];
+ totalHeight += lineRun.ascender + -lineRun.descender;
if( y < totalHeight )
{
return lineIndex;
}
visualY = 0.0f;
- height = line.lineSize.height;
+ height = line.ascender + -line.descender;
}
void UpdateCursorPosition()
lastGlyph = (lineRuns[lineIndex].glyphIndex + lineRuns[lineIndex].numberOfGlyphs);
if( cursorGlyph < lastGlyph )
{
- height = lineRuns[lineIndex].lineSize.height;
+ const LineRun& lineRun = lineRuns[lineIndex];
+ height = lineRun.ascender + -lineRun.descender;
break;
}
}
}
- mDecorator->SetPosition( PRIMARY_CURSOR, visualX, visualY, height );
+ mDecorator->SetPosition( PRIMARY_CURSOR, visualX, visualY, height, height ); // TODO: To be fixed in the next patch.
mDecoratorUpdated = true;
}
bool mUpdateCursorPosition : 1; ///< True if the visual position of the cursor must be recalculated
};
-struct Controller::FontDefaults
-{
- FontDefaults()
- : mDefaultPointSize(0.0f),
- mFontId(0u)
- {
- }
-
- FontId GetFontId( TextAbstraction::FontClient& fontClient )
- {
- if( !mFontId )
- {
- Dali::TextAbstraction::PointSize26Dot6 pointSize = mDefaultPointSize*64;
- mFontId = fontClient.GetFontId( mDefaultFontFamily, mDefaultFontStyle, pointSize );
- }
-
- return mFontId;
- }
-
- std::string mDefaultFontFamily;
- std::string mDefaultFontStyle;
- float mDefaultPointSize;
- FontId mFontId;
-};
-
struct Controller::Impl
{
Impl( ControlInterface& controlInterface )