@@ -43,6 +43,7 @@ QList<SlurOffsets> SlurTie::editUps;
4343SlurSegment::SlurSegment (Score* score)
4444 : SpannerSegment(score)
4545 {
46+ setFlag (ElementFlag::ON_STAFF, true );
4647 autoAdjustOffset = QPointF ();
4748 }
4849
@@ -113,6 +114,7 @@ void SlurSegment::updateGrips(int* n, int* defaultGrip, QRectF* r) const
113114 *n = int (GripSlurSegment::GRIPS);
114115 *defaultGrip = int (GripSlurSegment::END);
115116 QPointF p (pagePos ());
117+ p -= QPointF (0.0 , system ()->staff (staffIdx ())->y ()); // ??
116118 for (int i = 0 ; i < int (GripSlurSegment::GRIPS); ++i)
117119 r[i].translate (ups[i].p + ups[i].off * spatium () + p);
118120 }
@@ -453,10 +455,6 @@ void SlurSegment::read(XmlReader& e)
453455 else if (!Element::readProperties (e))
454456 e.unknown ();
455457 }
456- if ((staffIdx () > 0 ) && score ()->mscVersion () < 201 ) {
457- // discard any user tweaking for older scores
458- setReadPos (QPointF ());
459- }
460458 }
461459
462460// ---------------------------------------------------------
@@ -564,10 +562,6 @@ void Slur::computeBezier(SlurSegment* ss, QPointF p6o)
564562 ss->shapePath .cubicTo (p3 + p3o - th, p4 + p4o - th, p2);
565563 ss->shapePath .cubicTo (p4 +p4o + th, p3 + p3o + th, QPointF ());
566564
567- QPointF staffOffset;
568- if (ss->system () && ss->track () >= 0 )
569- staffOffset = QPointF (0.0 , -ss->system ()->staff (ss->staffIdx ())->y ());
570-
571565 // translate back
572566 t.reset ();
573567 t.translate (pp1.x (), pp1.y ());
@@ -580,6 +574,10 @@ void Slur::computeBezier(SlurSegment* ss, QPointF p6o)
580574 ss->ups [int (GripSlurSegment::DRAG)].p = t.map (p5);
581575 ss->ups [int (GripSlurSegment::SHOULDER)].p = t.map (p6);
582576
577+ QPointF staffOffset;
578+ if (ss->system () && ss->track () >= 0 )
579+ staffOffset = QPointF (0.0 , -ss->system ()->staff (ss->staffIdx ())->y ());
580+
583581 ss->path .translate (staffOffset);
584582 ss->shapePath .translate (staffOffset);
585583 }
@@ -644,6 +642,12 @@ void SlurSegment::layout(const QPointF& p1, const QPointF& p2)
644642 }
645643 }
646644 setbbox (path.boundingRect ());
645+ if ((staffIdx () > 0 ) && score ()->mscVersion () < 201 && !readPos ().isNull ()) {
646+ QPointF staffOffset;
647+ if (system () && track () >= 0 )
648+ staffOffset = QPointF (0.0 , system ()->staff (staffIdx ())->y ());
649+ setReadPos (readPos () + staffOffset);
650+ }
647651 adjustReadPos ();
648652 }
649653
@@ -1431,7 +1435,6 @@ void Slur::layout()
14311435 }
14321436 SlurSegment* segment = segmentAt (i);
14331437 segment->setSystem (system);
1434- segment->setFlag (ElementFlag::ON_STAFF, true );
14351438
14361439 // case 1: one segment
14371440 if (sPos .system1 == sPos .system2 ) {
0 commit comments