Skip to content

Commit

Permalink
Reverted afd4c43
Browse files Browse the repository at this point in the history
Tests are broken because of changes in read206.
remove unused old code for ledger line collision detection
  • Loading branch information
anatoly-os committed Oct 30, 2018
1 parent 2647ff8 commit 77a8687
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 35 deletions.
9 changes: 3 additions & 6 deletions libmscore/chord.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1493,16 +1493,16 @@ void Chord::layout2()
for (Chord* c : _graceNotes)
c->layout2();

qreal _spatium = spatium();
qreal mag = staff()->mag(tick());

#if 0
//
// Experimental:
// look for colliding ledger lines
//

qreal _spatium = spatium();
const qreal minDist = _spatium * .17;

Segment* ps = segment()->prev(SegmentType::ChordRest);
if (ps) {
int strack = staff2track(staffIdx());
Expand Down Expand Up @@ -1544,7 +1544,6 @@ void Chord::layout2()
}
}
}
#endif

//
// position after-chord grace notes
Expand Down Expand Up @@ -1730,6 +1729,7 @@ void Chord::layoutPitched()
qreal dotNoteDistance = score()->styleP(Sid::dotNoteDistance) * mag_;
qreal minNoteDistance = score()->styleP(Sid::minNoteDistance) * mag_;
qreal minTieLength = score()->styleP(Sid::MinTieLength) * mag_;
qreal ledgerLineLength = score()->styleP(Sid::ledgerLineLength) * mag_;

qreal graceMag = score()->styleD(Sid::graceNoteMag);
qreal chordX = (_noteType == NoteType::NORMAL) ? ipos().x() : 0.0;
Expand Down Expand Up @@ -1892,11 +1892,9 @@ void Chord::layoutPitched()
}
}

#if 0
if (_ledgerLines) {
// we may need to increase distance to previous chord
Chord* pc = 0;
qreal ledgerLineLength = score()->styleP(Sid::ledgerLineLength) * mag_;

if (_noteType == NoteType::NORMAL) {
// normal note
Expand Down Expand Up @@ -2014,7 +2012,6 @@ void Chord::layoutPitched()
lll = qMax(llsp, lll);
}
}
#endif

_spaceLw = lll;
_spaceRw = rrr;
Expand Down
30 changes: 2 additions & 28 deletions libmscore/read206.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,6 @@ static const Spatium defaultFrameWidth206 = Spatium(0.2);

//---------------------------------------------------------
// StyleVal206
// this is a list of default style values which are
// different in 3.x
//
// TODO: remove style values which are equal
//---------------------------------------------------------

struct StyleVal2 {
Expand Down Expand Up @@ -279,23 +275,6 @@ struct StyleVal2 {
{ Sid::barGraceDistance, QVariant(.6) },
{ Sid::rehearsalMarkFrameRound, QVariant(20) },
{ Sid::dynamicsFontItalic, QVariant(false) },

// { Sid::staffTextFontFace, "FreeSerif" },
// { Sid::staffTextFontSize, 10.0 },
// { Sid::staffTextFontBold, false },
// { Sid::staffTextFontItalic, false },
// { Sid::staffTextFontUnderline, false },
{ Sid::staffTextAlign, QVariant::fromValue(Align::LEFT | Align::TOP) }, // different from 3.x
// { Sid::staffTextOffsetType, int(OffsetType::SPATIUM) },
// { Sid::staffTextPlacement, int(Placement::ABOVE) },
// { Sid::staffTextPosAbove, QPointF(.0, -2.0) },
// { Sid::staffTextMinDistance, Spatium(0.5) },
// { Sid::staffTextFrameType, int(FrameType::NO_FRAME) },
// { Sid::staffTextFramePadding, 0.2 },
// { Sid::staffTextFrameWidth, 0.1 },
// { Sid::staffTextFrameRound, 0 },
// { Sid::staffTextFrameFgColor, QColor(0, 0, 0, 255) },
// { Sid::staffTextFrameBgColor, QColor(255, 255, 255, 0) },
};

//---------------------------------------------------------
Expand Down Expand Up @@ -351,7 +330,7 @@ void readPageFormat(MStyle* style, XmlReader& e)
}

//---------------------------------------------------------
// readTextStyle206
// readTextStyle
//---------------------------------------------------------

void readTextStyle206(MStyle* style, XmlReader& e)
Expand Down Expand Up @@ -1325,7 +1304,7 @@ bool readNoteProperties206(Note* note, XmlReader& e)
}

//---------------------------------------------------------
// readTextProperties206
// readTextProperties
//---------------------------------------------------------

static bool readTextProperties206(XmlReader& e, TextBase* t, Element* be)
Expand Down Expand Up @@ -1388,11 +1367,6 @@ static bool readTextProperties206(XmlReader& e, TextBase* t, Element* be)
qDebug("unknown alignment: <%s>", qPrintable(val));
t->setAlign(align);
}
else if (tag == "pos") {
t->readProperty(e, Pid::OFFSET);
if ((char(t->align()) & char(Align::VMASK)) == char(Align::TOP))
t->ryoffset() += .5 * t->score()->spatium(); // HACK: bbox is different in 2.x
}
else if (!t->readProperties(e))
return false;
return true;
Expand Down
2 changes: 1 addition & 1 deletion libmscore/shape.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ Shape Shape::translated(const QPointF& pt) const
//-------------------------------------------------------------------
// minHorizontalDistance
// a is located right of this shape.
// Calculates the minimum horizontal distance between the two shapes
// Calculates the minimum vertical distance between the two shapes
// so they dont touch.
//-------------------------------------------------------------------

Expand Down

0 comments on commit 77a8687

Please sign in to comment.