From 68340fe1f423b283a387fb58ce213425fc3b22a7 Mon Sep 17 00:00:00 2001 From: Jean Pierre Cimalando Date: Tue, 23 Feb 2021 07:07:41 +0100 Subject: [PATCH] Special case: don't color keys if range full --- plugins/editor/src/editor/GUIPiano.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/editor/src/editor/GUIPiano.cpp b/plugins/editor/src/editor/GUIPiano.cpp index b2c00459..22ec4681 100644 --- a/plugins/editor/src/editor/GUIPiano.cpp +++ b/plugins/editor/src/editor/GUIPiano.cpp @@ -55,6 +55,7 @@ void SPiano::draw(CDrawContext* dc) const Dimensions dim = getDimensions(false); const unsigned octs = octs_; const unsigned keyCount = octs * 12; + const bool allKeysUsed = keyUsed_.all(); dc->setDrawMode(kAntiAliasing); @@ -71,7 +72,7 @@ void SPiano::draw(CDrawContext* dc) CRect rect = keyRect(key); SColorHCY hcy(keyUsedHue_, 1.0, whiteKeyLuma_); - if (!keyUsed_[key]) { + if (!keyUsed_[key] || allKeysUsed) { hcy.y = 1.0; if (keyval_[key]) hcy.c = 0.0; @@ -99,7 +100,7 @@ void SPiano::draw(CDrawContext* dc) CRect rect = keyRect(key); SColorHCY hcy(keyUsedHue_, 1.0, blackKeyLuma_); - if (!keyUsed_[key]) + if (!keyUsed_[key] || allKeysUsed) hcy.c = 0.0; if (keyval_[key]) hcy.y = std::max(0.0f, hcy.y - keyLumaPressDelta_);