Skip to content

Commit

Permalink
fix #20508: Clefs and key sigs drawn wrongly in palettes
Browse files Browse the repository at this point in the history
  • Loading branch information
lasconic committed Mar 19, 2013
1 parent e56eb36 commit 137c4b7
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions mscore/palette.cpp
Expand Up @@ -555,7 +555,8 @@ void Palette::paintEvent(QPaintEvent* event)

for (int idx = 0; idx < cells.size(); ++idx) {
int yoffset = gscore->spatium() * _yOffset;
QRect r = idxRect(idx).translated(0, yoffset);
QRect r = idxRect(idx);
QRect rShift = r.translated(0, yoffset);
p.setPen(pen);
if (idx == selectedIdx)
p.fillRect(r, bgColor.light(200));
Expand All @@ -569,7 +570,7 @@ void Palette::paintEvent(QPaintEvent* event)
QFont f(p.font());
f.setPointSize(12);
p.setFont(f);
p.drawText(r, Qt::AlignLeft | Qt::AlignTop, cells[idx]->tag);
p.drawText(rShift, Qt::AlignLeft | Qt::AlignTop, cells[idx]->tag);
}

p.setPen(pen);
Expand All @@ -579,8 +580,8 @@ void Palette::paintEvent(QPaintEvent* event)
continue;
bool drawStaff = cells[idx]->drawStaff;
if (el->type() == Element::ICON) {
int x = r.x();
int y = r.y();
int x = rShift.x();
int y = rShift.y();
Icon* _icon = static_cast<Icon*>(el);
QIcon icon = _icon->icon();
static const int border = 2;
Expand Down

0 comments on commit 137c4b7

Please sign in to comment.