// 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;
}
}
mView.SetVisualModel( mVisualModel );
- // Set the shadow properties to default
+ // Set the text properties to default
+ mVisualModel->SetTextColor( Color::WHITE );
mVisualModel->SetShadowOffset( Vector2::ZERO );
mVisualModel->SetShadowColor( Vector4::ZERO );
+ mVisualModel->SetUnderlineEnabled( false );
}
~Impl()
}
}
+const Vector4& Controller::GetTextColor() const
+{
+ return mImpl->mVisualModel->GetTextColor();
+}
+
const Vector2& Controller::GetShadowOffset() const
{
return mImpl->mVisualModel->GetShadowOffset();
return mImpl->mVisualModel->GetShadowColor();
}
+const Vector4& Controller::GetUnderlineColor() const
+{
+ return mImpl->mVisualModel->GetUnderlineColor();
+}
+
+bool Controller::IsUnderlineEnabled() const
+{
+ return mImpl->mVisualModel->IsUnderlineEnabled();
+}
+
+void Controller::SetTextColor( const Vector4& textColor )
+{
+ mImpl->mVisualModel->SetTextColor( textColor );
+}
+
void Controller::SetShadowOffset( const Vector2& shadowOffset )
{
mImpl->mVisualModel->SetShadowOffset( shadowOffset );
mImpl->mVisualModel->SetShadowColor( shadowColor );
}
+void Controller::SetUnderlineColor( const Vector4& color )
+{
+ mImpl->mVisualModel->SetUnderlineColor( color );
+}
+
+void Controller::SetUnderlineEnabled( bool enabled )
+{
+ mImpl->mVisualModel->SetUnderlineEnabled( enabled );
+}
+
void Controller::EnableTextInput( DecoratorPtr decorator )
{
if( !mImpl->mTextInput )