Change-Id: I61398d876cc3614d97487a5c02c0dd51201f3420
{
if( mImpl->mVisualModel )
{
- return mImpl->mVisualModel->GetNumberOfGlyphs();
+ VisualModel& model = *mImpl->mVisualModel;
+
+ Length glyphCount = model.GetNumberOfGlyphs();
+ Length positionCount = model.GetNumberOfGlyphPositions();
+
+ DALI_ASSERT_DEBUG( positionCount <= glyphCount && "Invalid glyph positions in Model" );
+
+ return (positionCount < glyphCount) ? positionCount : glyphCount;
}
return 0;
memcpy( modelPositions.Begin(), glyphPositions, numberOfGlyphs * sizeof( Vector2 ) );
}
+Length VisualModel::GetNumberOfGlyphPositions() const
+{
+ return mImpl->mGlyphPositions.Count();
+}
+
void VisualModel::GetGlyphPositions( Vector2* glyphPositions,
GlyphIndex glyphIndex,
Length numberOfGlyphs ) const
Length numberOfGlyphs );
/**
+ * Retrieves the number of glyph positions set.
+ *
+ * @note This may be less than the number of glyphs in the model.
+ * @return The number of glyphs.
+ */
+ Length GetNumberOfGlyphPositions() const;
+
+ /**
* @brief Retrieves the glyph positions.
*
* @pre The size of the @p positions buffer needs to be big enough to copy the @p numberOfGlyphs positions.