|
From: Tapio V. <aa...@us...> - 2011-02-23 10:27:53
|
Author: Tapio Vierros <tap...@gm...>
Date: Wed Feb 23 12:26:56 2011 +0200
Shorten black piano keys.
---
editorapp.cc | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/editorapp.cc b/editorapp.cc
index a185764..48edf71 100644
--- a/editorapp.cc
+++ b/editorapp.cc
@@ -947,8 +947,9 @@ void Piano::updatePixmap(int noteHeight)
QPen pen; pen.setWidth(2); pen.setColor(QColor("#c0c0c0"));
painter.setPen(pen);
for (int i = 0; i < notes; ++i) {
- QColor background(scale.isSharp(i) ? "#000000" : "#ffffff");
- painter.fillRect(0, image.height() - i*noteHeight - noteHeight/2, image.width(), noteHeight, background);
+ bool sh = scale.isSharp(i);
+ QColor background(sh ? "#000000" : "#ffffff");
+ painter.fillRect(0, image.height() - i*noteHeight - noteHeight/2, image.width() * (sh ? 0.8 : 1.0), noteHeight, background);
painter.drawRect(0, image.height() - i*noteHeight - noteHeight/2, image.width(), noteHeight);
}
}
|