소스 검색

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 년 전
부모
커밋
d746fc478b
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  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);