From 762ea47747d1f972c9c894fc556f3546e6a6e6d1 Mon Sep 17 00:00:00 2001 From: Yaraslau Tamashevich Date: Mon, 29 Jan 2024 09:10:57 +0200 Subject: [PATCH] Fix crispy::flags contains function --- metainfo.xml | 1 + src/crispy/flags.h | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/metainfo.xml b/metainfo.xml index 0b9925b8e0..6f7edcf501 100644 --- a/metainfo.xml +++ b/metainfo.xml @@ -107,6 +107,7 @@
    +
  • Fixes Windows alt/control key modifiers (#1408).
  • Fixes Windows built accidentally not including builtin-SSH support (#1427).
  • Fixes some text run segmentation problems, e.g., not making use of some programming ligatures (#395).
  • Fixes mouse scroll wheel events going into the wrong direction if `Alt` modifier was pressed at the same time (#394).
  • diff --git a/src/crispy/flags.h b/src/crispy/flags.h index 5e7ca29137..bbe294f79d 100644 --- a/src/crispy/flags.h +++ b/src/crispy/flags.h @@ -52,9 +52,11 @@ class flags _value &= ~static_cast(flags._value); } + // Tests for existence of all given flags to be present. + // @return true if all flags are set in this flags set, false otherwise. [[nodiscard]] constexpr bool contains(flags flags) const noexcept { - return _value & flags.value(); + return (_value & flags.value()) == flags.value(); } [[nodiscard]] constexpr bool test(flag_type flag) const noexcept { return contains(flag); }