Skip to content

Commit

Permalink
fix #20869
Browse files Browse the repository at this point in the history
  • Loading branch information
wschweer committed Jul 16, 2013
1 parent 58c07cc commit 38afa5e
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 10 deletions.
Binary file modified fonts/mscore-20.ttf
Binary file not shown.
20 changes: 14 additions & 6 deletions libmscore/layout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -261,12 +261,20 @@ void Score::layoutChords1(QList<Note*>& notes, int voices, Staff* staff, Segment
x = stemX - hw + stemWidth5 * 2;
}
else {
// center whole note
qreal xd = (note->headWidth() - noteHeadWidth()) * .5;
if (_up)
x = stemX - hw + xd;
else
x = -xd;
if (chord->durationType().headType() == Note::HEAD_WHOLE) {
// center whole note
qreal xd = (note->headWidth() - hw) * .5;
if (_up)
x = stemX - hw + xd;
else
x = -xd;
}
else {
if (_up)
x = stemX - hw;
else
x = 0.0;
}
}
note->rypos() = (note->line() + stepOffset) * stepDistance;
note->rxpos() = x;
Expand Down
9 changes: 5 additions & 4 deletions mscore/scoreview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2030,6 +2030,7 @@ void ScoreView::constraintCanvas (int* dxx, int* dyy)
static void drawDebugInfo(QPainter& p, const Element* _e)
{
const Element* e = _e;
#if 0
if (e->type() == Element::NOTE) {
e = e->parent();
const ChordRest* cr = static_cast<const ChordRest*>(e);
Expand All @@ -2048,7 +2049,7 @@ static void drawDebugInfo(QPainter& p, const Element* _e)
p.translate(-pos);
return;
}

#endif
//
// draw bounding box rectangle for all
// selected Elements
Expand All @@ -2057,13 +2058,13 @@ static void drawDebugInfo(QPainter& p, const Element* _e)
p.translate(pos);
p.setBrush(Qt::NoBrush);

p.setPen(Qt::red);
p.setPen(QPen(Qt::red, 0.0));
p.drawPath(e->shape());

// p.setPen(Qt::red);
// p.drawRect(e->bbox());

p.setPen(Qt::red);
p.setPen(QPen(Qt::red, 0.0));
qreal w = 5.0 / p.matrix().m11();
qreal h = w;
qreal x = 0; // e->bbox().x();
Expand All @@ -2079,7 +2080,7 @@ static void drawDebugInfo(QPainter& p, const Element* _e)
else if (e->type() == Element::CLEF)
ee = static_cast<const Clef*>(e)->segment();

p.setPen(Qt::green);
p.setPen(QPen(Qt::green, 0.0));

p.drawRect(ee->pageBoundingRect());

Expand Down

0 comments on commit 38afa5e

Please sign in to comment.