From 667dfc9e62e39ebfe29f27833a4dc73da8c20979 Mon Sep 17 00:00:00 2001 From: nieznanysprawiciel Date: Sun, 24 Nov 2024 12:23:23 +0100 Subject: [PATCH] Fix: Add cached enties to the list of fonts returned --- swGraphicAPI/Assets/TextAsset/Loader/FontPicker.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/swGraphicAPI/Assets/TextAsset/Loader/FontPicker.cpp b/swGraphicAPI/Assets/TextAsset/Loader/FontPicker.cpp index f6920ca1..d32f2bc7 100644 --- a/swGraphicAPI/Assets/TextAsset/Loader/FontPicker.cpp +++ b/swGraphicAPI/Assets/TextAsset/Loader/FontPicker.cpp @@ -108,7 +108,11 @@ Nullable< std::vector< FontSearchEntry > > FontPicker::ListFonts( PathsManager* for( auto& file : files ) { if( m_metadataCache.find( file ) != m_metadataCache.end() ) + { + FontSearchEntry cachedEntry{ m_metadataCache[ file ], LoadPath( AssetPath( file, "" ), pm ) }; + entries.push_back( cachedEntry ); continue; + } auto meta = GetFontMetadata( pm, file ); if( meta.IsValid() )