LibGUI: Add VerticalDirection::operator!

This allows to invert the direction of a VerticalDirection.
This commit is contained in:
Lucas CHOLLET 2022-06-07 22:44:13 +02:00 committed by Linus Groh
commit cb4844bf64
Notes: sideshowbarker 2024-07-17 08:48:34 +09:00

View file

@ -52,6 +52,13 @@ enum class VerticalDirection {
Down
};
constexpr VerticalDirection operator!(VerticalDirection const& other)
{
if (other == VerticalDirection::Up)
return VerticalDirection::Down;
return VerticalDirection::Up;
}
constexpr VerticalDirection key_code_to_vertical_direction(KeyCode const& key)
{
if (key == Key_Up)