Skip to content

Commit

Permalink
fix musescore#25939: layout of chordline & gliss in tab staff
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcSabatella committed Jun 2, 2014
1 parent 7eca27a commit bc4ba4e
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 7 deletions.
17 changes: 12 additions & 5 deletions libmscore/chord.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2152,8 +2152,11 @@ void Chord::layoutTablature()
// know the y position of the next staves
}

if (_glissando)
lll += _spatium * .5;
if (_glissando) {
lll += _spatium * 0.5;
if (rtick())
lll += score()->styleS(StyleIdx::MinTieLength).val() * _spatium;
}

if (dots()) {
qreal x = dotPosX() + dotNoteDistance
Expand Down Expand Up @@ -2222,9 +2225,13 @@ void Chord::layoutTablature()
for (Element* e : _el) {
e->layout();
if (e->type() == ElementType::CHORDLINE) {
int x = e->bbox().translated(e->pos()).right();
if (x > _space.rw())
_space.setRw(x);
QRectF tbbox = e->bbox().translated(e->pos());
qreal lx = tbbox.left();
qreal rx = tbbox.right();
if (-lx > _space.lw())
_space.setLw(-lx);
if (rx > _space.rw())
_space.setRw(rx);
}
}
// bbox();
Expand Down
10 changes: 9 additions & 1 deletion vtest/gen
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@ else
BROWSER=konqueror
fi

if [ -n $VTEST_MSCORE ]; then
MSCORE="$VTEST_MSCORE"
fi

if [ -n $VTEST_BROWSER ]; then
BROWSER="$VTEST_BROWSER"
fi

#
# "compare" - image magick compare program
#
Expand All @@ -27,7 +35,7 @@ else
accidental-1 accidental-2 accidental-3 accidental-4\
accidental-5 accidental-6 accidental-7 accidental-8\
tie-1 grace-1 grace-2 grace-3 harmony-1 beams-1 beams-2 user-offset-1 user-offset-2\
chord-space-1"
chord-space-1 tablature-1"
fi

DPI=130
Expand Down
2 changes: 1 addition & 1 deletion vtest/gen.bat
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ set SRC=mmrest-1,bravura-mmrest,mmrest-2,mmrest-4,mmrest-5,mmrest-6,mmrest-7,mmr
accidental-1,accidental-2,accidental-3,accidental-4, ^
accidental-5,accidental-6,accidental-7,accidental-8, ^
tie-1,grace-1,grace-2,grace-3,harmony-1,beams-1,beams-2,user-offset-1,user-offset-2, ^
chord-space-1
chord-space-1,tablature-1

set MSCORE=..\win32install\bin\mscore.exe
set DPI=130
Expand Down
Binary file added vtest/tablature-1-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/tablature-1.mscz
Binary file not shown.

0 comments on commit bc4ba4e

Please sign in to comment.