Skip to content

Commit

Permalink
Merge pull request #485 from mgavioli/Fix_22706_missing_symbol_in_tab…
Browse files Browse the repository at this point in the history
…_measure_rests

Fix #22706 - Missing symbols in TAB duration symbols
  • Loading branch information
mgavioli committed Sep 21, 2013
2 parents 059e00f + e39dfc9 commit c135292
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions libmscore/rest.cpp
Expand Up @@ -320,12 +320,21 @@ void Rest::layout()
if (staff() && staff()->isTabStaff()) {
StaffTypeTablature* tab = (StaffTypeTablature*)staff()->staffType();
// if rests are shown and note values are shown as duration symbols
if(tab->showRests() &&tab->genDurations()) {
if(tab->showRests() && tab->genDurations()) {
TDuration::DurationType type = durationType().type();
int dots = durationType().dots();
// if rest is whole measure, convert into actual type and dot values
if (type == TDuration::V_MEASURE) {
int ticks = measure()->ticks();
TDuration dur = TDuration(Fraction::fromTicks(ticks)).type();
type = dur.type();
dots = dur.dots();
}
// symbol needed; if not exist, create, if exists, update duration
if (!_tabDur)
_tabDur = new TabDurationSymbol(score(), tab, durationType().type(), dots());
_tabDur = new TabDurationSymbol(score(), tab, type, dots);
else
_tabDur->setDuration(durationType().type(), dots(), tab);
_tabDur->setDuration(type, dots, tab);
_tabDur->setParent(this);
// needed? _tabDur->setTrack(track());
_tabDur->layout();
Expand Down

0 comments on commit c135292

Please sign in to comment.