Skip to content

Commit

Permalink
Fix flex formatting test and minor include/comment fixups
Browse files Browse the repository at this point in the history
  • Loading branch information
mikke89 committed Feb 16, 2025
1 parent 9363a12 commit 679aab8
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Source/Core/ElementHandle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ void ElementHandle::ProcessDefaultAction(Event& event)
{
HandleEdgeMarginParser parser;
if (!parser.Parse(edge_margin_str, edge_margin))
Log::Message(Log::LT_WARNING, "Failed to parse 'edge-constraints' attribute for element '%s'.", GetAddress().c_str());
Log::Message(Log::LT_WARNING, "Failed to parse 'edge_margin' attribute for element '%s'.", GetAddress().c_str());
}

initialised = true;
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/Layout/FlexFormattingContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ UniquePtr<LayoutBox> FlexFormattingContext::Format(ContainerBox* parent_containe

Vector2f FlexFormattingContext::GetMaxContentSize(Element* element)
{
// A large but finite number is used here, since layouting doesn't always work well infinities.
// A large but finite number is used here, since layouting doesn't always work well with infinities.
const Vector2f infinity(10000.0f, 10000.0f);
RootBox root(infinity);
auto flex_container_box = MakeUnique<FlexContainer>(element, &root);
Expand Down
2 changes: 2 additions & 0 deletions Tests/Source/Common/TypesToString.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,11 @@
#ifndef RMLUI_TESTS_COMMON_TYPESTOSTRING_H
#define RMLUI_TESTS_COMMON_TYPESTOSTRING_H

#include <RmlUi/Core/Mesh.h>
#include <RmlUi/Core/TypeConverter.h>
#include <RmlUi/Core/Types.h>
#include <RmlUi/Core/Variant.h>
#include <RmlUi/Core/Vertex.h>
#include <doctest.h>
#include <ostream>

Expand Down
3 changes: 2 additions & 1 deletion Tests/Source/UnitTests/FlexFormatting.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ TEST_CASE("FlexFormatting")

CAPTURE(test_case.align_items);
CAPTURE(test_case.flex_direction);
CHECK(checkbox->GetBox().GetSize() == test_case.expected_size);
CHECK(checkbox->GetBox().GetSize().x == doctest::Approx(test_case.expected_size.x));
CHECK(checkbox->GetBox().GetSize().y == doctest::Approx(test_case.expected_size.y));
}

document->Close();
Expand Down

0 comments on commit 679aab8

Please sign in to comment.