mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1062963 patch 2: changes and additions to WritingModes.h. r=jfkthame
This commit is contained in:
parent
1c299d429d
commit
af76344d0a
@ -507,6 +507,12 @@ public:
|
|||||||
aContainerWidth);
|
aContainerWidth);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool operator==(LogicalPoint aOther) const
|
||||||
|
{
|
||||||
|
CHECK_WRITING_MODE(aOther.GetWritingMode());
|
||||||
|
return mPoint == aOther.mPoint;
|
||||||
|
}
|
||||||
|
|
||||||
LogicalPoint operator+(const LogicalPoint& aOther) const
|
LogicalPoint operator+(const LogicalPoint& aOther) const
|
||||||
{
|
{
|
||||||
CHECK_WRITING_MODE(aOther.GetWritingMode());
|
CHECK_WRITING_MODE(aOther.GetWritingMode());
|
||||||
@ -518,6 +524,33 @@ public:
|
|||||||
mPoint.y + aOther.mPoint.y);
|
mPoint.y + aOther.mPoint.y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LogicalPoint& operator+=(const LogicalPoint& aOther)
|
||||||
|
{
|
||||||
|
CHECK_WRITING_MODE(aOther.GetWritingMode());
|
||||||
|
I() += aOther.I();
|
||||||
|
B() += aOther.B();
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
LogicalPoint operator-(const LogicalPoint& aOther) const
|
||||||
|
{
|
||||||
|
CHECK_WRITING_MODE(aOther.GetWritingMode());
|
||||||
|
// In non-debug builds, LogicalPoint does not store the WritingMode,
|
||||||
|
// so the first parameter here (which will always be eUnknownWritingMode)
|
||||||
|
// is ignored.
|
||||||
|
return LogicalPoint(GetWritingMode(),
|
||||||
|
mPoint.x - aOther.mPoint.x,
|
||||||
|
mPoint.y - aOther.mPoint.y);
|
||||||
|
}
|
||||||
|
|
||||||
|
LogicalPoint& operator-=(const LogicalPoint& aOther)
|
||||||
|
{
|
||||||
|
CHECK_WRITING_MODE(aOther.GetWritingMode());
|
||||||
|
I() -= aOther.I();
|
||||||
|
B() -= aOther.B();
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
friend class LogicalRect;
|
friend class LogicalRect;
|
||||||
|
|
||||||
@ -1320,6 +1353,12 @@ public:
|
|||||||
|
|
||||||
void SetEmpty() { mRect.SetEmpty(); }
|
void SetEmpty() { mRect.SetEmpty(); }
|
||||||
|
|
||||||
|
bool IsEqualEdges(const LogicalRect aOther) const
|
||||||
|
{
|
||||||
|
CHECK_WRITING_MODE(aOther.GetWritingMode());
|
||||||
|
return mRect.IsEqualEdges(aOther.mRect);
|
||||||
|
}
|
||||||
|
|
||||||
/* XXX are these correct?
|
/* XXX are these correct?
|
||||||
nscoord ILeft(WritingMode aWritingMode) const
|
nscoord ILeft(WritingMode aWritingMode) const
|
||||||
{
|
{
|
||||||
@ -1432,17 +1471,17 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0 // XXX this would require aContainerWidth as well
|
|
||||||
/**
|
/**
|
||||||
* Return a LogicalRect representing this rect in a different writing mode
|
* Return a LogicalRect representing this rect in a different writing mode
|
||||||
*/
|
*/
|
||||||
LogicalRect ConvertTo(WritingMode aToMode, WritingMode aFromMode) const
|
LogicalRect ConvertTo(WritingMode aToMode, WritingMode aFromMode,
|
||||||
|
nscoord aContainerWidth) const
|
||||||
{
|
{
|
||||||
CHECK_WRITING_MODE(aFromMode);
|
CHECK_WRITING_MODE(aFromMode);
|
||||||
return aToMode == aFromMode ?
|
return aToMode == aFromMode ?
|
||||||
*this : LogicalRect(aToMode, GetPhysicalRect(aFromMode));
|
*this : LogicalRect(aToMode, GetPhysicalRect(aFromMode, aContainerWidth),
|
||||||
|
aContainerWidth);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
LogicalRect() MOZ_DELETE;
|
LogicalRect() MOZ_DELETE;
|
||||||
|
Loading…
Reference in New Issue
Block a user