Bug 1079154 patch 2: add SetPosition with a LogicalPoint to nsIFrame, r=jfkthame

This commit is contained in:
Simon Montagu 2015-01-06 23:10:07 -08:00
parent 647520926b
commit 02b85bac8f

View File

@ -726,6 +726,15 @@ public:
SetRect(nsRect(mRect.TopLeft(), aSize));
}
void SetPosition(const nsPoint& aPt) { mRect.MoveTo(aPt); }
void SetPosition(mozilla::WritingMode aWritingMode,
const mozilla::LogicalPoint& aPt,
nscoord aContainerWidth) {
// We subtract mRect.width from the container width to account for
// the fact that logical origins in RTL coordinate systems are at
// the top right of the frame instead of the top left.
mRect.MoveTo(aPt.GetPhysicalPoint(aWritingMode,
aContainerWidth - mRect.width));
}
/**
* Move the frame, accounting for relative positioning. Use this when