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
Родитель 999a094a1f
Коммит 4aff46b627
1 изменённых файлов: 9 добавлений и 0 удалений

Просмотреть файл

@ -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