Browse Source

FormatElement cleanup

Michael Ragazzon 5 years ago
parent
commit
0ae3737a83

+ 1 - 1
Include/RmlUi/Core/ElementUtilities.h

@@ -110,7 +110,7 @@ public:
 	/// for non-DOM elements of custom elements.
 	/// @param[in] element The element to lay out.
 	/// @param[in] containing_block The size of the element's containing block.
-	static bool FormatElement(Element* element, const Vector2f& containing_block);
+	static void FormatElement(Element* element, Vector2f containing_block);
 
 	/// Generates the box for an element.
 	/// @param[out] box The box to be built.

+ 3 - 3
Source/Core/ElementUtilities.cpp

@@ -65,7 +65,7 @@ static void SetBox(Element* element)
 }
 
 // Positions an element relative to an offset parent.
-static void SetElementOffset(Element* element, const Vector2f& offset)
+static void SetElementOffset(Element* element, Vector2f offset)
 {
 	Vector2f relative_offset = element->GetParentNode()->GetBox().GetPosition(Box::CONTENT);
 	relative_offset += offset;
@@ -302,9 +302,9 @@ void ElementUtilities::ApplyActiveClipRegion(Context* context, RenderInterface*
 }
 
 // Formats the contents of an element.
-bool ElementUtilities::FormatElement(Element* element, const Vector2f& containing_block)
+void ElementUtilities::FormatElement(Element* element, Vector2f containing_block)
 {
-	return LayoutEngine::FormatElement(element, containing_block);
+	LayoutEngine::FormatElement(element, containing_block);
 }
 
 // Generates the box for an element.

+ 1 - 3
Source/Core/LayoutEngine.cpp

@@ -49,7 +49,7 @@ struct LayoutChunk
 static Pool< LayoutChunk > layout_chunk_pool(200, true);
 
 // Formats the contents for a root-level element (usually a document or floating element).
-bool LayoutEngine::FormatElement(Element* element, Vector2f containing_block)
+void LayoutEngine::FormatElement(Element* element, Vector2f containing_block)
 {
 #ifdef RMLUI_ENABLE_PROFILING
 	RMLUI_ZoneScopedC(0xB22222);
@@ -76,8 +76,6 @@ bool LayoutEngine::FormatElement(Element* element, Vector2f containing_block)
 
 	block_context_box->CloseAbsoluteElements();
 	element->OnLayout();
-
-	return true;
 }
 
 void* LayoutEngine::AllocateLayoutChunk(size_t size)

+ 1 - 1
Source/Core/LayoutEngine.h

@@ -46,7 +46,7 @@ public:
 	/// @param element[in] The element to lay out.
 	/// @param containing_block[in] The size of the containing block.
 	/// @param shrink_to_fit[in] True to shrink the element to the width of its contents.
-	static bool FormatElement(Element* element, Vector2f containing_block);
+	static void FormatElement(Element* element, Vector2f containing_block);
 
 	/// Positions a single element and its children within a block formatting context.
 	/// @param[in] block_context_box The open block box to layout the element in.