Skip to content

Commit

Permalink
Adjust code style
Browse files Browse the repository at this point in the history
  • Loading branch information
Harmoniker1 committed Jul 28, 2020
1 parent 01e8a76 commit 04f0db7
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 33 deletions.
2 changes: 1 addition & 1 deletion libmscore/chord.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1536,7 +1536,7 @@ qreal Chord::minAbsStemLength() const
if (hasHook) {
beamLvl += (up() ? 4 : 2); // reserve more space for stem with both hook and tremolo
}
const qreal additionalHeight = beamLvl ? 0 : sw * spatium();
const qreal additionalHeight = beamLvl ? 0 : (sw * spatium());

return height + beamLvl * beamDist + additionalHeight;
}
Expand Down
39 changes: 19 additions & 20 deletions libmscore/edit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -812,26 +812,25 @@ void Score::cmdAddTimeSig(Measure* fm, int staffIdx, TimeSig* ts, bool local)
return;
}

auto getStaffIdxRange = [this, local, staffIdx](const Score* score) -> std::pair<int /*start*/, int /*end*/> {
int startStaffIdx, endStaffIdx;
if (local) {
if (score == this) {
startStaffIdx = staffIdx;
endStaffIdx = startStaffIdx + 1;
}
else {
// TODO: get index for this score
qDebug("cmdAddTimeSig: unable to write local time signature change to linked score");
startStaffIdx = 0;
endStaffIdx = 0;
}
}
else {
startStaffIdx = 0;
endStaffIdx = score->nstaves();
}
return std::make_pair(startStaffIdx, endStaffIdx);
};
auto getStaffIdxRange
= [this, local, staffIdx](const Score* score) -> std::pair<int /*start*/, int /*end*/> {
int startStaffIdx, endStaffIdx;
if (local) {
if (score == this) {
startStaffIdx = staffIdx;
endStaffIdx = startStaffIdx + 1;
} else {
// TODO: get index for this score
qDebug("cmdAddTimeSig: unable to write local time signature change to linked score");
startStaffIdx = 0;
endStaffIdx = 0;
}
} else {
startStaffIdx = 0;
endStaffIdx = score->nstaves();
}
return std::make_pair(startStaffIdx, endStaffIdx);
};

if (ots && ots->sig() == ns && ots->stretch() == ts->stretch()) {
//
Expand Down
17 changes: 9 additions & 8 deletions libmscore/score.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4329,14 +4329,15 @@ int Score::duration()
//---------------------------------------------------------

int Score::durationWithoutRepeats()
{
masterScore()->setExpandRepeats(false);
const RepeatList& rl = repeatList();
if (rl.empty())
return 0;
const RepeatSegment* rs = rl.last();
return lrint(utick2utime(rs->utick + rs->len()));
}
{
masterScore()->setExpandRepeats(false);
const RepeatList& rl = repeatList();
if (rl.empty()) {
return 0;
}
const RepeatSegment* rs = rl.last();
return lrint(utick2utime(rs->utick + rs->len()));
}

//---------------------------------------------------------
// createRehearsalMarkText
Expand Down
7 changes: 3 additions & 4 deletions libmscore/tremolo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -258,11 +258,11 @@ void Tremolo::layoutOneNoteTremolo(qreal x, qreal y, qreal spatium)
if (!up && !(line & 1)) { // stem is down; even line
t = qMax(4.0 + offset - 2.0 * minHeight(), 3.0);
} else if (!up && (line & 1)) { // stem is down; odd line
t = qMax(5.0 - 2.0 * minHeight(), 3.0);
t = qMax(5.0 - 2.0 * minHeight(), 3.0);
} else if (up && !(line & 1)) { // stem is up; even line
t = qMin(-3.0 - 2.0 * minHeight(), -4.0 - offset);
t = qMin(-3.0 - 2.0 * minHeight(), -4.0 - offset);
} else { /*if ( up && (line & 1))*/ // stem is up; odd line
t = qMin(-3.0 - 2.0 * minHeight(), -5.0);
t = qMin(-3.0 - 2.0 * minHeight(), -5.0);
}
}

Expand Down Expand Up @@ -535,7 +535,6 @@ void Tremolo::layout()
}
}


//---------------------------------------------------------
// crossStaffBeamBetween
// Return true if tremolo is two-note cross-staff and beams between staves
Expand Down

0 comments on commit 04f0db7

Please sign in to comment.