return mModel->GetColorIndices();
}
+const Vector4* const ViewModel::GetBackgroundColors() const
+{
+ return mModel->GetBackgroundColors();
+}
+
+const ColorIndex* const ViewModel::GetBackgroundColorIndices() const
+{
+ return mModel->GetBackgroundColorIndices();
+}
+
const Vector4& ViewModel::GetDefaultColor() const
{
return mModel->GetDefaultColor();
// Need to reshape the glyph as the font may be different in size.
const GlyphInfo& ellipsisGlyph = fontClient.GetEllipsisGlyph( fontClient.GetPointSize( glyphToRemove.fontId ) );
- if( !firstPenSet )
+ if( !firstPenSet || EqualsZero( glyphToRemove.advance ) )
{
const Vector2& position = *( elidedPositionsBuffer + index );
removedGlypsWidth = -ellipsisGlyph.xBearing;
- firstPenSet = true;
+ if( !EqualsZero( firstPenX ) )
+ {
+ firstPenSet = true;
+ }
}
removedGlypsWidth += std::min( glyphToRemove.advance, ( glyphToRemove.xBearing + glyphToRemove.width ) );
// Calculate the width of the ellipsis glyph and check if it fits.
const float ellipsisGlyphWidth = ellipsisGlyph.width + ellipsisGlyph.xBearing;
- if( ellipsisGlyphWidth < removedGlypsWidth )
+ // If it is the last glyph to remove, add the ellipsis glyph without checking its width.
+ if( ( ellipsisGlyphWidth < removedGlypsWidth ) || ( index == 0u ) )
{
GlyphInfo& glyphInfo = *( elidedGlyphsBuffer + index );
Vector2& position = *( elidedPositionsBuffer + index );
glyphInfo = ellipsisGlyph;
// Change the 'x' and 'y' position of the ellipsis glyph.
+ if( position.x > firstPenX )
+ {
+ position.x = firstPenX;
+ if (ellipsisGlyphWidth < removedGlypsWidth)
+ {
+ position.x += removedGlypsWidth - ellipsisGlyphWidth;
+ }
+ }
+
position.x += ellipsisGlyph.xBearing;
position.y = penY - ellipsisGlyph.yBearing;