diff --git a/include/TGUI/Color.hpp b/include/TGUI/Color.hpp index b2baa8ff1..0358d1960 100644 --- a/include/TGUI/Color.hpp +++ b/include/TGUI/Color.hpp @@ -39,18 +39,12 @@ namespace tgui { class Color; -} -namespace tgui -{ namespace priv { TGUI_API Color constructColorFromString(const String& string); } -} -namespace tgui -{ ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /// @brief Wrapper for colors /// @@ -300,12 +294,9 @@ namespace tgui {U"transparent"sv, Color::Transparent}} }; #endif -} ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -namespace tgui -{ namespace priv { ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/src/Global.cpp b/src/Global.cpp index ee055ba6e..a94dd36d0 100644 --- a/src/Global.cpp +++ b/src/Global.cpp @@ -26,9 +26,7 @@ #include #include "TGUI/Exception.hpp" -#include #include -#include #include #include // C header for compatibility with _wfopen_s, NOLINT(modernize-deprecated-headers) diff --git a/src/Widgets/Slider.cpp b/src/Widgets/Slider.cpp index 14fb8a402..5bb41cd41 100644 --- a/src/Widgets/Slider.cpp +++ b/src/Widgets/Slider.cpp @@ -243,7 +243,7 @@ namespace tgui // Set the new maximum m_maximum = maximum; - // The minimum can't be below the maximum + // The minimum can't be above the maximum if (m_minimum > m_maximum) setMinimum(m_maximum); diff --git a/tests/Text.cpp b/tests/Text.cpp index fb3d08277..4bed3e767 100644 --- a/tests/Text.cpp +++ b/tests/Text.cpp @@ -23,6 +23,7 @@ ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// #include "TGUI/Color.hpp" +#include "TGUI/TextStyle.hpp" #include "Tests.hpp" TEST_CASE("[Text]") @@ -165,5 +166,13 @@ TEST_CASE("[Text]") text3.setFont("resources/DejaVuSans.ttf"); REQUIRE(text.getSize().y == text3.getSize().y); } + + SECTION("Line width without font") + { + REQUIRE(text.getLineWidth("Foo", nullptr, 0, {}) == 0.0f); + REQUIRE(text.getLineWidth("Bar", nullptr, 1, tgui::TextStyle::Underlined) == 0.0f); + REQUIRE(text.getLineWidth("Baz", nullptr, 42, {}) == 0.0f);; + REQUIRE(text.getLineWidth("FooBar", nullptr, 666, tgui::TextStyle::StrikeThrough) == 0.0f); + } } }