Просмотр исходного кода

Fix some absolutely positioned elements not being placed.

Michael Ragazzon 5 лет назад
Родитель
Сommit
b0196fdeca
2 измененных файлов с 3 добавлено и 3 удалено
  1. 2 3
      Source/Core/LayoutBlockBox.h
  2. 1 0
      Source/Core/LayoutEngine.cpp

+ 2 - 3
Source/Core/LayoutBlockBox.h

@@ -107,6 +107,8 @@ public:
 	/// rendering in a block-context.
 	/// @param element[in] The element to be positioned absolutely within this block box.
 	void AddAbsoluteElement(Element* element);
+	/// Formats, sizes, and positions all absolute elements in this block.
+	void CloseAbsoluteElements();
 
 	/// Returns the offset from the top-left corner of this box's offset element the next child box will be
 	/// positioned at.
@@ -167,9 +169,6 @@ private:
 		Vector2f position;
 	};
 
-	/// Formats, sizes, and positions all absolute elements in this block.
-	void CloseAbsoluteElements();
-
 	// Closes our last block box, if it is an open inline block box.
 	CloseResult CloseInlineBlockBox();
 

+ 1 - 0
Source/Core/LayoutEngine.cpp

@@ -74,6 +74,7 @@ bool LayoutEngine::FormatElement(Element* element, Vector2f containing_block)
 			break;
 	}
 
+	block_context_box->CloseAbsoluteElements();
 	element->OnLayout();
 
 	return true;