From 908ac85f51601b8f0aeb2b38c0951b66a8814c4c Mon Sep 17 00:00:00 2001 From: Dalton Messmer Date: Sun, 6 Nov 2022 02:14:18 -0500 Subject: [PATCH] Fix pattern clip colors from pre-1.3 versions --- src/core/PatternClip.cpp | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/src/core/PatternClip.cpp b/src/core/PatternClip.cpp index 7ea56cd4872..9af9bda6ad3 100644 --- a/src/core/PatternClip.cpp +++ b/src/core/PatternClip.cpp @@ -83,19 +83,20 @@ void PatternClip::loadSettings(const QDomElement& element) toggleMute(); } - // for colors saved in 1.3-onwards - if( element.hasAttribute( "color" ) && !element.hasAttribute( "usestyle" ) ) + if (element.hasAttribute("color")) { - useCustomClipColor( true ); - setColor( element.attribute( "color" ) ); - } - - // for colors saved before 1.3 - else if(element.hasAttribute("color")) - { - setColor(QColor(element.attribute("color").toUInt())); - - // usestyle attribute is no longer used + if (!element.hasAttribute("usestyle")) + { + // for colors saved in 1.3-onwards + setColor(element.attribute("color")); + useCustomClipColor(true); + } + else + { + // for colors saved before 1.3 + setColor(QColor(element.attribute("color").toUInt())); + useCustomClipColor(element.attribute("usestyle").toUInt() == 0); + } } else {