Skip to content

Commit

Permalink
fixes & vtest for whole notes
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcSabatella committed Jul 22, 2014
1 parent 95f5cb5 commit 5ce6b24
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 3 deletions.
10 changes: 8 additions & 2 deletions libmscore/slur.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -801,6 +801,11 @@ void Slur::slurPos(SlurPos* sp)

sp->p1 = scr->pagePos() - sp->system1->pagePos();
sp->p2 = ecr->pagePos() - sp->system2->pagePos();
// account for centering or other adjustments (other than mirroring)
if (!note1->mirror())
sp->p1.rx() += note1->x();
if (!note2->mirror())
sp->p2.rx() += note2->x();

qreal xo, yo;

Expand All @@ -820,7 +825,6 @@ void Slur::slurPos(SlurPos* sp)
}

qreal __up = _up ? -1.0 : 1.0;
qreal hw = note1 ? note1->headWidth() : startCR()->width();
switch (sa1) {
case SlurAnchor::STEM: //sc can't be null
sp->p1 += sc->stemPos() - sc->pagePos() + sc->stem()->p2();
Expand All @@ -845,14 +849,15 @@ void Slur::slurPos(SlurPos* sp)
//
//------p1
bool stemPos = false; // p1 starts at chord stem side
qreal hw = note1 ? note1->headWidth() : startCR()->width();
xo = hw * .5;
if (note1)
yo = note1->pos().y();
else if(_up)
yo = startCR()->bbox().top();
else
yo = startCR()->bbox().top() + startCR()->height();
yo += _spatium * .9 * __up;
xo = hw * .5;

if (stem1) { //sc not null
Beam* beam1 = sc->beam();
Expand Down Expand Up @@ -905,6 +910,7 @@ void Slur::slurPos(SlurPos* sp)
sp->p1 += QPointF(xo, yo);

//------p2
hw = note2 ? note2->headWidth() : endCR()->width();
xo = hw * .5;
if (note2)
yo = note2->pos().y();
Expand Down
2 changes: 1 addition & 1 deletion vtest/gen
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ else
emmentaler-3 bravura-3 emmentaler-4 bravura-4 emmentaler-5 bravura-5\
emmentaler-6 bravura-6 emmentaler-7 bravura-7\
emmentaler-8 bravura-8 emmentaler-9 bravura-9 emmentaler-10 bravura-10\
emmentaler-11 bravura-11 frametext ottava slurs-1\
emmentaler-11 bravura-11 frametext ottava slurs-1 slurs-2\
chord-layout-1 chord-layout-2 chord-layout-3 chord-layout-4 chord-layout-5 chord-layout-6\
chord-layout-7 chord-layout-8 chord-layout-9 chord-layout-10 chord-layout-11 chord-layout-12\
accidental-1 accidental-2 accidental-3 accidental-4\
Expand Down
1 change: 1 addition & 0 deletions vtest/gen.bat
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ set SRC=mmrest-1,bravura-mmrest,mmrest-2,mmrest-4,mmrest-5,mmrest-6,mmrest-7,mmr
emmentaler-3,bravura-3,emmentaler-4,bravura-4,emmentaler-5,bravura-5, ^
emmentaler-6,bravura-6,emmentaler-7,bravura-7, ^
emmentaler-8,bravura-8,emmentaler-9,bravura-9,emmentaler-10,bravura-10, ^
emmentlar-11,bravura-11,frametext,ottava,slurs-1,slurs-2, ^
chord-layout-1,chord-layout-2,chord-layout-3,chord-layout-4,chord-layout-5,chord-layout-6, ^
chord-layout-7,chord-layout-8,chord-layout-9,chord-layout-10,chord-layout-11,chord-layout-12, ^
accidental-1,accidental-2,accidental-3,accidental-4, ^
Expand Down
Binary file added vtest/slurs-2-ref.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added vtest/slurs-2.mscz
Binary file not shown.

0 comments on commit 5ce6b24

Please sign in to comment.