From f7c5d3950d37d1ba04020dd2b4b44a74e60b7dd3 Mon Sep 17 00:00:00 2001 From: Bowon Ryu Date: Thu, 28 Dec 2023 15:11:40 +0900 Subject: [PATCH] Fix ellipsis cache issue If an ellipsis cache is not found in the mEllipsisCache, the ellipsisCacheIndex value will always be zero. This zero value is then stored in the item.index, which is used to access the mEllipsisCache. As a result, even if an ellipsis cache exists, only the cache at index 0 is always used, so an ellipsis glyph with a different font size from the actual font size may be rendered. Change-Id: Iee15f1e320fd3f8ba73e035477ed13d7e49ee0ef Signed-off-by: Bowon Ryu --- .../text/text-abstraction/plugin/font-client-plugin-impl.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dali/internal/text/text-abstraction/plugin/font-client-plugin-impl.cpp b/dali/internal/text/text-abstraction/plugin/font-client-plugin-impl.cpp index 99caffe..2d9ac73 100644 --- a/dali/internal/text/text-abstraction/plugin/font-client-plugin-impl.cpp +++ b/dali/internal/text/text-abstraction/plugin/font-client-plugin-impl.cpp @@ -1004,7 +1004,6 @@ const GlyphInfo& FontClient::Plugin::GetEllipsisGlyph(PointSize26Dot6 requestedP EllipsisItem item; item.requestedPointSize = requestedPointSize; - item.index = ellipsisCacheIndex; // Find a font for the ellipsis glyph. item.glyph.fontId = FindDefaultFont(ELLIPSIS_CHARACTER, @@ -1020,7 +1019,12 @@ const GlyphInfo& FontClient::Plugin::GetEllipsisGlyph(PointSize26Dot6 requestedP DALI_LOG_INFO(gFontClientLogFilter, Debug::General, " glyph id %d found in the cache.\n", item.glyph.index); DALI_LOG_INFO(gFontClientLogFilter, Debug::General, " font %d.\n", item.glyph.fontId); + // EllipsisCacheIndex is stored in item.index. ellipsisCacheIndex = mCacheHandler->CacheEllipsis(std::move(item)); + if(!mCacheHandler->mEllipsisCache.empty()) + { + mCacheHandler->mEllipsisCache.back().index = ellipsisCacheIndex; + } } return mCacheHandler->mEllipsisCache[ellipsisCacheIndex].glyph; } -- 2.7.4