Issue #1925 - Convert NS_SIDE_TO_FULL_CORNER to a constexpr function.

This commit is contained in:
Moonchild 2024-08-02 10:36:07 +02:00 committed by roytam1
commit 2a399b60a1
3 changed files with 13 additions and 5 deletions

View file

@ -479,6 +479,16 @@ constexpr bool SideIsVertical(Side aSide)
return aSide % 2;
}
/* @param aIsSecond: when true, return the clockwise second of the two
* corners associated with aSide. For example, with aSide = eSideBottom the
* result is eCornerBottomRight when aIsSecond is false, and
* eCornerBottomLeft when aIsSecond is true.
*/
constexpr Corner SideToFullCorner(Side aSide, bool aIsSecond)
{
return Corner((aSide + aIsSecond) % 4);
}
} // namespace mozilla
#endif /* MOZILLA_GFX_TYPES_H_ */