Skip to content

Commit

Permalink
Merge pull request #5681 from njvdberg/issue-277712-repeat-sign
Browse files Browse the repository at this point in the history
fix # 277712 - repeat sign when add lines
  • Loading branch information
dmitrio95 committed Feb 8, 2020
2 parents bf4ad9f + 6d99f58 commit 745146a
Showing 1 changed file with 2 additions and 36 deletions.
38 changes: 2 additions & 36 deletions libmscore/stafftype.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -358,24 +358,7 @@ void StaffType::read(XmlReader& e)

qreal StaffType::doty1() const
{
switch(_lines) {
case 1:
return -_lineDistance.val() * .5;
case 2:
return -_lineDistance.val() * .5;
case 3:
return _lineDistance.val() * .5;
case 4:
return _lineDistance.val() * .5;
case 5:
return _lineDistance.val() * 1.5;
case 6:
return _lineDistance.val() * 1.5;
default:
qDebug("StaffType::doty1(): lines %d unsupported", _lines);
break;
}
return 0.0;
return _lineDistance.val() * (static_cast<qreal>((_lines - 1)/2) - 0.5);
}

//---------------------------------------------------------
Expand All @@ -385,24 +368,7 @@ qreal StaffType::doty1() const

qreal StaffType::doty2() const
{
switch(_lines) {
case 1:
return _lineDistance.val() * .5;
case 2:
return _lineDistance.val() * 1.5;
case 3:
return _lineDistance.val() * 1.5;
case 4:
return _lineDistance.val() * 2.5;
case 5:
return _lineDistance.val() * 2.5;
case 6:
return _lineDistance.val() * 3.5;
default:
qDebug("StaffType::doty2(): lines %d unsupported", _lines);
break;
}
return 0.0;
return _lineDistance.val() * (static_cast<qreal>(_lines/2) + 0.5);
}

//---------------------------------------------------------
Expand Down

0 comments on commit 745146a

Please sign in to comment.