mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-26 18:37:31 +09:00
Issue #1925 - Move NS_FOR_CSS_HALF_CORNER to gfx/2d/Types.h and rewrite it.
This commit is contained in:
parent
8dc8875db6
commit
1730199755
2 changed files with 16 additions and 2 deletions
|
|
@ -443,6 +443,22 @@ enum HalfCorner {
|
|||
eCornerBottomLeftY = 7
|
||||
};
|
||||
|
||||
// Creates a for loop that walks over the eight mozilla::HalfCorner values.
|
||||
// This implementation uses the same technique as NS_FOR_CSS_SIDES.
|
||||
#define NS_FOR_CSS_HALF_CORNERS(var_) \
|
||||
int32_t MOZ_CONCAT(var_,__LINE__) = mozilla::eCornerTopLeftX; \
|
||||
for (mozilla::HalfCorner var_; \
|
||||
MOZ_CONCAT(var_,__LINE__) <= mozilla::eCornerBottomLeftY && \
|
||||
(var_ = mozilla::HalfCorner(MOZ_CONCAT(var_,__LINE__)), true); \
|
||||
++MOZ_CONCAT(var_,__LINE__))
|
||||
|
||||
static inline mozilla::HalfCorner operator++(mozilla::HalfCorner& aHalfCorner) {
|
||||
MOZ_ASSERT(aHalfCorner >= eCornerTopLeftX && aHalfCorner <= eCornerBottomLeftY,
|
||||
"Out of range half corner!");
|
||||
aHalfCorner = mozilla::HalfCorner(aHalfCorner + 1);
|
||||
return aHalfCorner;
|
||||
}
|
||||
|
||||
} // namespace mozilla
|
||||
|
||||
#endif /* MOZILLA_GFX_TYPES_H_ */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue