Bugfix: inexact font loading using font name, warning about font substitution

This commit is contained in:
Jakub Melka
2019-10-02 19:37:19 +02:00
parent 2dfb653233
commit efef799c09
5 changed files with 51 additions and 12 deletions

View File

@ -59,6 +59,21 @@ public:
return m_object;
}
/// Returns the cached object. If object is dirty, then cached object is refreshed.
/// \param holder Holder object, which owns the cached item
/// \param function Refresh function
template<typename H>
inline const T& get(H* holder, T(H::* function)(void))
{
if (m_dirty)
{
m_object = (holder->*function)();
m_dirty = false;
}
return m_object;
}
/// Invalidates the cached item, so it must be refreshed from the cache next time,
/// if it is accessed.
inline void dirty()