From 50863c144e5fc28ce9a2ef39187b3e920be6195f Mon Sep 17 00:00:00 2001 From: attila Date: Mon, 3 Feb 2025 12:34:54 +0100 Subject: [PATCH] ShapedTextOptions: Add equality operators --- .../detail/juce_SimpleShapedText.h | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/modules/juce_graphics/detail/juce_SimpleShapedText.h b/modules/juce_graphics/detail/juce_SimpleShapedText.h index c08283c105..42afc4d2bf 100644 --- a/modules/juce_graphics/detail/juce_SimpleShapedText.h +++ b/modules/juce_graphics/detail/juce_SimpleShapedText.h @@ -44,7 +44,30 @@ enum class TextDirection class ShapedTextOptions { +private: + auto tie() const + { + return std::tie (justification, + readingDir, + maxWidth, + height, + fontsForRange, + language, + firstLineIndent, + leading, + additiveLineSpacing, + baselineAtZero, + allowBreakingInsideWord, + trailingWhitespacesShouldFit, + maxNumLines, + ellipsis); + } + public: + bool operator== (const ShapedTextOptions& other) const { return tie() == other.tie(); } + bool operator!= (const ShapedTextOptions& other) const { return tie() != other.tie(); } + + //============================================================================== [[nodiscard]] ShapedTextOptions withJustification (Justification x) const { return withMember (*this, &ShapedTextOptions::justification, x);