зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1143218 patch 2: Add LineLeft and LineRight accessors to LogicalRect, r=jfkthame
This commit is contained in:
Родитель
4454a1b4b5
Коммит
f66d48dc0f
|
@ -1471,6 +1471,30 @@ public:
|
|||
return mRect.height;
|
||||
}
|
||||
|
||||
/**
|
||||
* Accessors for line-relative coordinates
|
||||
*/
|
||||
nscoord LineLeft(WritingMode aWritingMode, nscoord aContainerWidth) const
|
||||
{
|
||||
CHECK_WRITING_MODE(aWritingMode);
|
||||
if (aWritingMode.IsVertical()) {
|
||||
return IStart(); // sideways-left will require aContainerHeight
|
||||
} else {
|
||||
return aWritingMode.IsBidiLTR() ? IStart()
|
||||
: aContainerWidth - IEnd();
|
||||
}
|
||||
}
|
||||
nscoord LineRight(WritingMode aWritingMode, nscoord aContainerWidth) const
|
||||
{
|
||||
CHECK_WRITING_MODE(aWritingMode);
|
||||
if (aWritingMode.IsVertical()) {
|
||||
return IEnd(); // sideways-left will require aContainerHeight
|
||||
} else {
|
||||
return aWritingMode.IsBidiLTR() ? IEnd()
|
||||
: aContainerWidth - IStart();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Physical coordinates of the rect.
|
||||
*/
|
||||
|
@ -1603,19 +1627,6 @@ public:
|
|||
return mRect.IsEqualEdges(aOther.mRect);
|
||||
}
|
||||
|
||||
/* XXX are these correct?
|
||||
nscoord ILeft(WritingMode aWritingMode) const
|
||||
{
|
||||
CHECK_WRITING_MODE(aWritingMode);
|
||||
return aWritingMode.IsBidiLTR() ? IStart() : IEnd();
|
||||
}
|
||||
nscoord IRight(WritingMode aWritingMode) const
|
||||
{
|
||||
CHECK_WRITING_MODE(aWritingMode);
|
||||
return aWritingMode.IsBidiLTR() ? IEnd() : IStart();
|
||||
}
|
||||
*/
|
||||
|
||||
LogicalPoint Origin(WritingMode aWritingMode) const
|
||||
{
|
||||
CHECK_WRITING_MODE(aWritingMode);
|
||||
|
|
Загрузка…
Ссылка в новой задаче