Special case: don't color keys if range full
This commit is contained in:
parent
2638ef0cff
commit
68340fe1f4
1 changed files with 3 additions and 2 deletions
|
|
@ -55,6 +55,7 @@ void SPiano::draw(CDrawContext* dc)
|
||||||
const Dimensions dim = getDimensions(false);
|
const Dimensions dim = getDimensions(false);
|
||||||
const unsigned octs = octs_;
|
const unsigned octs = octs_;
|
||||||
const unsigned keyCount = octs * 12;
|
const unsigned keyCount = octs * 12;
|
||||||
|
const bool allKeysUsed = keyUsed_.all();
|
||||||
|
|
||||||
dc->setDrawMode(kAntiAliasing);
|
dc->setDrawMode(kAntiAliasing);
|
||||||
|
|
||||||
|
|
@ -71,7 +72,7 @@ void SPiano::draw(CDrawContext* dc)
|
||||||
CRect rect = keyRect(key);
|
CRect rect = keyRect(key);
|
||||||
|
|
||||||
SColorHCY hcy(keyUsedHue_, 1.0, whiteKeyLuma_);
|
SColorHCY hcy(keyUsedHue_, 1.0, whiteKeyLuma_);
|
||||||
if (!keyUsed_[key]) {
|
if (!keyUsed_[key] || allKeysUsed) {
|
||||||
hcy.y = 1.0;
|
hcy.y = 1.0;
|
||||||
if (keyval_[key])
|
if (keyval_[key])
|
||||||
hcy.c = 0.0;
|
hcy.c = 0.0;
|
||||||
|
|
@ -99,7 +100,7 @@ void SPiano::draw(CDrawContext* dc)
|
||||||
CRect rect = keyRect(key);
|
CRect rect = keyRect(key);
|
||||||
|
|
||||||
SColorHCY hcy(keyUsedHue_, 1.0, blackKeyLuma_);
|
SColorHCY hcy(keyUsedHue_, 1.0, blackKeyLuma_);
|
||||||
if (!keyUsed_[key])
|
if (!keyUsed_[key] || allKeysUsed)
|
||||||
hcy.c = 0.0;
|
hcy.c = 0.0;
|
||||||
if (keyval_[key])
|
if (keyval_[key])
|
||||||
hcy.y = std::max(0.0f, hcy.y - keyLumaPressDelta_);
|
hcy.y = std::max(0.0f, hcy.y - keyLumaPressDelta_);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue