Remove unused old code for ledger line collision detection.
Tune text offset on import from 2.x.
This commit is contained in:
parent
77a86873bf
commit
5540473361
24 changed files with 56 additions and 6 deletions
|
@ -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());
|
||||
|
@ -1544,6 +1544,7 @@ void Chord::layout2()
|
|||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
//
|
||||
// position after-chord grace notes
|
||||
|
@ -1729,7 +1730,6 @@ 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;
|
||||
|
@ -1892,9 +1892,11 @@ 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
|
||||
|
@ -2012,6 +2014,7 @@ void Chord::layoutPitched()
|
|||
lll = qMax(llsp, lll);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
_spaceLw = lll;
|
||||
_spaceRw = rrr;
|
||||
|
|
|
@ -83,6 +83,10 @@ 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 {
|
||||
|
@ -275,6 +279,23 @@ 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) },
|
||||
};
|
||||
|
||||
//---------------------------------------------------------
|
||||
|
@ -330,7 +351,7 @@ void readPageFormat(MStyle* style, XmlReader& e)
|
|||
}
|
||||
|
||||
//---------------------------------------------------------
|
||||
// readTextStyle
|
||||
// readTextStyle206
|
||||
//---------------------------------------------------------
|
||||
|
||||
void readTextStyle206(MStyle* style, XmlReader& e)
|
||||
|
@ -1304,7 +1325,7 @@ bool readNoteProperties206(Note* note, XmlReader& e)
|
|||
}
|
||||
|
||||
//---------------------------------------------------------
|
||||
// readTextProperties
|
||||
// readTextProperties206
|
||||
//---------------------------------------------------------
|
||||
|
||||
static bool readTextProperties206(XmlReader& e, TextBase* t, Element* be)
|
||||
|
@ -1367,6 +1388,11 @@ 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;
|
||||
|
|
|
@ -59,7 +59,7 @@ Shape Shape::translated(const QPointF& pt) const
|
|||
//-------------------------------------------------------------------
|
||||
// minHorizontalDistance
|
||||
// a is located right of this shape.
|
||||
// Calculates the minimum vertical distance between the two shapes
|
||||
// Calculates the minimum horizontal distance between the two shapes
|
||||
// so they dont touch.
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
<clefKeyRightMargin>1.75</clefKeyRightMargin>
|
||||
<barNoteDistance>1.2</barNoteDistance>
|
||||
<dynamicsFontItalic>0</dynamicsFontItalic>
|
||||
<staffAlign>left,top</staffAlign>
|
||||
<Spatium>1.76389</Spatium>
|
||||
</Style>
|
||||
<showInvisible>1</showInvisible>
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
<clefKeyRightMargin>1.75</clefKeyRightMargin>
|
||||
<barNoteDistance>1.2</barNoteDistance>
|
||||
<dynamicsFontItalic>0</dynamicsFontItalic>
|
||||
<staffAlign>left,top</staffAlign>
|
||||
<Spatium>1.76389</Spatium>
|
||||
</Style>
|
||||
<showInvisible>1</showInvisible>
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
<barNoteDistance>1.2</barNoteDistance>
|
||||
<lastSystemFillLimit>0</lastSystemFillLimit>
|
||||
<dynamicsFontItalic>0</dynamicsFontItalic>
|
||||
<staffAlign>left,top</staffAlign>
|
||||
<Spatium>1.76389</Spatium>
|
||||
</Style>
|
||||
<showInvisible>1</showInvisible>
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
<barNoteDistance>1.2</barNoteDistance>
|
||||
<lastSystemFillLimit>0</lastSystemFillLimit>
|
||||
<dynamicsFontItalic>0</dynamicsFontItalic>
|
||||
<staffAlign>left,top</staffAlign>
|
||||
<Spatium>1.76389</Spatium>
|
||||
</Style>
|
||||
<showInvisible>1</showInvisible>
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
<barNoteDistance>1.2</barNoteDistance>
|
||||
<lastSystemFillLimit>0</lastSystemFillLimit>
|
||||
<dynamicsFontItalic>0</dynamicsFontItalic>
|
||||
<staffAlign>left,top</staffAlign>
|
||||
<Spatium>1.76389</Spatium>
|
||||
</Style>
|
||||
<showInvisible>1</showInvisible>
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
<clefKeyRightMargin>1.75</clefKeyRightMargin>
|
||||
<barNoteDistance>1.2</barNoteDistance>
|
||||
<dynamicsFontItalic>0</dynamicsFontItalic>
|
||||
<staffAlign>left,top</staffAlign>
|
||||
<Spatium>1.76389</Spatium>
|
||||
</Style>
|
||||
<showInvisible>1</showInvisible>
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
<clefKeyRightMargin>1.75</clefKeyRightMargin>
|
||||
<barNoteDistance>1.2</barNoteDistance>
|
||||
<dynamicsFontItalic>0</dynamicsFontItalic>
|
||||
<staffAlign>left,top</staffAlign>
|
||||
<Spatium>1.76389</Spatium>
|
||||
</Style>
|
||||
<showInvisible>1</showInvisible>
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
<clefKeyRightMargin>1.75</clefKeyRightMargin>
|
||||
<barNoteDistance>1.2</barNoteDistance>
|
||||
<dynamicsFontItalic>0</dynamicsFontItalic>
|
||||
<staffAlign>left,top</staffAlign>
|
||||
<Spatium>1.76389</Spatium>
|
||||
</Style>
|
||||
<showInvisible>1</showInvisible>
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
<clefKeyRightMargin>1.75</clefKeyRightMargin>
|
||||
<barNoteDistance>1.2</barNoteDistance>
|
||||
<dynamicsFontItalic>0</dynamicsFontItalic>
|
||||
<staffAlign>left,top</staffAlign>
|
||||
<Spatium>1.76389</Spatium>
|
||||
</Style>
|
||||
<showInvisible>1</showInvisible>
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
<clefKeyRightMargin>1.75</clefKeyRightMargin>
|
||||
<barNoteDistance>1.2</barNoteDistance>
|
||||
<dynamicsFontItalic>0</dynamicsFontItalic>
|
||||
<staffAlign>left,top</staffAlign>
|
||||
<Spatium>1.76389</Spatium>
|
||||
</Style>
|
||||
<showInvisible>1</showInvisible>
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
<defaultFrameWidth>0</defaultFrameWidth>
|
||||
<longInstrumentAlign>center,center</longInstrumentAlign>
|
||||
<dynamicsFontItalic>0</dynamicsFontItalic>
|
||||
<staffAlign>left,top</staffAlign>
|
||||
<Spatium>1.76389</Spatium>
|
||||
</Style>
|
||||
<showInvisible>1</showInvisible>
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
<pedalPosBelow x="0" y="0"/>
|
||||
<trillPosAbove x="0" y="0"/>
|
||||
<dynamicsFontItalic>0</dynamicsFontItalic>
|
||||
<staffAlign>left,top</staffAlign>
|
||||
<Spatium>1.76389</Spatium>
|
||||
</Style>
|
||||
<showInvisible>1</showInvisible>
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
<clefKeyRightMargin>1.75</clefKeyRightMargin>
|
||||
<barNoteDistance>1.2</barNoteDistance>
|
||||
<dynamicsFontItalic>0</dynamicsFontItalic>
|
||||
<staffAlign>left,top</staffAlign>
|
||||
<Spatium>1.76389</Spatium>
|
||||
</Style>
|
||||
<showInvisible>1</showInvisible>
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
<clefKeyRightMargin>1.75</clefKeyRightMargin>
|
||||
<barNoteDistance>1.2</barNoteDistance>
|
||||
<dynamicsFontItalic>0</dynamicsFontItalic>
|
||||
<staffAlign>left,top</staffAlign>
|
||||
<Spatium>1.76389</Spatium>
|
||||
</Style>
|
||||
<showInvisible>1</showInvisible>
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
<clefKeyRightMargin>1.75</clefKeyRightMargin>
|
||||
<barNoteDistance>1.2</barNoteDistance>
|
||||
<dynamicsFontItalic>0</dynamicsFontItalic>
|
||||
<staffAlign>left,top</staffAlign>
|
||||
<Spatium>1.76389</Spatium>
|
||||
</Style>
|
||||
<showInvisible>1</showInvisible>
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
<barNoteDistance>1.2</barNoteDistance>
|
||||
<lastSystemFillLimit>0</lastSystemFillLimit>
|
||||
<dynamicsFontItalic>0</dynamicsFontItalic>
|
||||
<staffAlign>left,top</staffAlign>
|
||||
<Spatium>1.76389</Spatium>
|
||||
</Style>
|
||||
<showInvisible>1</showInvisible>
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
<barNoteDistance>1.2</barNoteDistance>
|
||||
<lastSystemFillLimit>0</lastSystemFillLimit>
|
||||
<dynamicsFontItalic>0</dynamicsFontItalic>
|
||||
<staffAlign>left,top</staffAlign>
|
||||
<Spatium>1.76389</Spatium>
|
||||
</Style>
|
||||
<showInvisible>1</showInvisible>
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
<barNoteDistance>1.2</barNoteDistance>
|
||||
<lastSystemFillLimit>0</lastSystemFillLimit>
|
||||
<dynamicsFontItalic>0</dynamicsFontItalic>
|
||||
<staffAlign>left,top</staffAlign>
|
||||
<Spatium>1.76389</Spatium>
|
||||
</Style>
|
||||
<showInvisible>1</showInvisible>
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
<barNoteDistance>1.2</barNoteDistance>
|
||||
<lastSystemFillLimit>0</lastSystemFillLimit>
|
||||
<dynamicsFontItalic>0</dynamicsFontItalic>
|
||||
<staffAlign>left,top</staffAlign>
|
||||
<Spatium>1.76389</Spatium>
|
||||
</Style>
|
||||
<showInvisible>1</showInvisible>
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
<barNoteDistance>1.2</barNoteDistance>
|
||||
<lastSystemFillLimit>0</lastSystemFillLimit>
|
||||
<dynamicsFontItalic>0</dynamicsFontItalic>
|
||||
<staffAlign>left,top</staffAlign>
|
||||
<Spatium>1.76389</Spatium>
|
||||
</Style>
|
||||
<showInvisible>1</showInvisible>
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
<barNoteDistance>1.2</barNoteDistance>
|
||||
<lastSystemFillLimit>0</lastSystemFillLimit>
|
||||
<dynamicsFontItalic>0</dynamicsFontItalic>
|
||||
<staffAlign>left,top</staffAlign>
|
||||
<Spatium>1.76389</Spatium>
|
||||
</Style>
|
||||
<showInvisible>1</showInvisible>
|
||||
|
|
Loading…
Reference in a new issue