Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions include/TGUI/Color.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
///
Expand Down Expand Up @@ -300,12 +294,9 @@ namespace tgui
{U"transparent"sv, Color::Transparent}}
};
#endif
}

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

namespace tgui
{
namespace priv
{
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Expand Down
2 changes: 0 additions & 2 deletions src/Global.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@
#include <TGUI/Backend/Window/Backend.hpp>
#include "TGUI/Exception.hpp"

#include <functional>
#include <sstream>
#include <locale>
#include <limits>

#include <stdio.h> // C header for compatibility with _wfopen_s, NOLINT(modernize-deprecated-headers)
Expand Down
2 changes: 1 addition & 1 deletion src/Widgets/Slider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
9 changes: 9 additions & 0 deletions tests/Text.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

#include "TGUI/Color.hpp"
#include "TGUI/TextStyle.hpp"
#include "Tests.hpp"

TEST_CASE("[Text]")
Expand Down Expand Up @@ -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);
}
}
}