Browse Source

Updating offset of absolutely positioned blocks.

Added an else to avoid offsetting absolutely positioned blocks twice if
both the `left` and `right` properties are set to something other than
`auto`.
Fredrik Berggren 10 years ago
parent
commit
d746fc478b
1 changed files with 1 additions and 1 deletions
  1. 1 1
      Source/Core/Element.cpp

+ 1 - 1
Source/Core/Element.cpp

@@ -1836,7 +1836,7 @@ void Element::UpdateOffset()
 			// If the element is anchored right, then the position is set first so the element's right-most edge
 			// (including margins) will render up against the containing box's right-most content edge, and then
 			// offset by the resolved value.
-			if (right != NULL && right->unit != Property::KEYWORD)
+			else if (right != NULL && right->unit != Property::KEYWORD)
 				relative_offset_base.x = containing_block.x + parent_box.GetEdge(Box::BORDER, Box::LEFT) - (ResolveProperty(RIGHT, containing_block.x) + GetBox().GetSize(Box::BORDER).x + GetBox().GetEdge(Box::MARGIN, Box::RIGHT));
 
 			const Property *top = GetLocalProperty(TOP);