2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Fix working with layers.

Regression was introduced in df64c97.

New base::flags work correctly only if all mutually exclusive flag
values use mutually exclusive bits (a & b == 0 for exclusive (a, b)).

Closes #3856.
This commit is contained in:
John Preston
2017-09-03 21:36:06 +03:00
parent 8f82880b93
commit 2e374e68c5
13 changed files with 95 additions and 95 deletions

View File

@@ -30,34 +30,34 @@ QString GetOverride(const QString &familyName);
} // namespace
enum class RectPart {
None = 0,
None = 0,
TopLeft = (1 << 0),
Top = (1 << 1),
TopRight = (1 << 2),
Left = (1 << 3),
Center = (1 << 4),
Right = (1 << 5),
BottomLeft = (1 << 6),
Bottom = (1 << 7),
TopLeft = (1 << 0),
Top = (1 << 1),
TopRight = (1 << 2),
Left = (1 << 3),
Center = (1 << 4),
Right = (1 << 5),
BottomLeft = (1 << 6),
Bottom = (1 << 7),
BottomRight = (1 << 8),
FullTop = TopLeft | Top | TopRight,
FullTop = TopLeft | Top | TopRight,
NoTopBottom = Left | Center | Right,
FullBottom = BottomLeft | Bottom | BottomRight,
NoTop = NoTopBottom | FullBottom,
NoBottom = FullTop | NoTopBottom,
FullBottom = BottomLeft | Bottom | BottomRight,
NoTop = NoTopBottom | FullBottom,
NoBottom = FullTop | NoTopBottom,
FullLeft = TopLeft | Left | BottomLeft,
FullLeft = TopLeft | Left | BottomLeft,
NoLeftRight = Top | Center | Bottom,
FullRight = TopRight | Right | BottomRight,
NoLeft = NoLeftRight | FullRight,
NoRight = FullLeft | NoLeftRight,
FullRight = TopRight | Right | BottomRight,
NoLeft = NoLeftRight | FullRight,
NoRight = FullLeft | NoLeftRight,
CornersMask = TopLeft | TopRight | BottomLeft | BottomRight,
SidesMask = Top | Bottom | Left | Right,
SidesMask = Top | Bottom | Left | Right,
Full = FullTop | NoTop,
Full = FullTop | NoTop,
};
using RectParts = base::flags<RectPart>;
inline constexpr auto is_flag_type(RectPart) { return true; };