From 4e05dd3cd36da029051e92203a2f9b20c8f3a472 Mon Sep 17 00:00:00 2001 From: Evil Eye Date: Sun, 21 May 2023 18:21:42 +0200 Subject: [PATCH] Make FontWrapper conditional --- components/widgets/fontwrapper.hpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/components/widgets/fontwrapper.hpp b/components/widgets/fontwrapper.hpp index e72b99a77b..6dd14596f4 100644 --- a/components/widgets/fontwrapper.hpp +++ b/components/widgets/fontwrapper.hpp @@ -1,6 +1,7 @@ #ifndef OPENMW_WIDGETS_WRAPPER_H #define OPENMW_WIDGETS_WRAPPER_H +#include #include #include @@ -10,6 +11,7 @@ namespace Gui template class FontWrapper : public T { +#if MYGUI_VERSION <= MYGUI_DEFINE_VERSION(3, 4, 2) public: void setFontName(const std::string& name) override { @@ -22,6 +24,7 @@ namespace Gui { T::setPropertyOverride(_key, _value); + // https://github.com/MyGUI/mygui/issues/113 // There is a bug in MyGUI: when it initializes the FontName property, it reset the font height. // We should restore it. if (_key == "FontName") @@ -31,7 +34,7 @@ namespace Gui } private: - std::string getFontSize() + const std::string& getFontSize() { // Note: we can not use the FontLoader here, so there is a code duplication a bit. static const std::string fontSize @@ -39,6 +42,7 @@ namespace Gui return fontSize; } }; +#endif } #endif