File tree Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -4596,4 +4596,26 @@ void Measure::computeMinWidth()
45964596 computeMinWidth (s, x, isSystemHeader);
45974597 }
45984598
4599+ qreal Measure::computeFirstSegmentXPosition (Segment* segment)
4600+ {
4601+ qreal x = 0 ;
4602+
4603+ Shape ls (QRectF (0.0 , 0.0 , 0.0 , spatium () * 4 ));
4604+
4605+ x = segment->minLeft (ls);
4606+
4607+ if (segment->isChordRestType ())
4608+ x += score ()->styleP (hasAccidental (segment) ? Sid::barAccidentalDistance : Sid::barNoteDistance);
4609+ else if (segment->isClefType () || segment->isHeaderClefType ())
4610+ x += score ()->styleP (Sid::clefLeftMargin);
4611+ else if (segment->isKeySigType ())
4612+ x = qMax (x, score ()->styleP (Sid::keysigLeftMargin));
4613+ else if (segment->isTimeSigType ())
4614+ x = qMax (x, score ()->styleP (Sid::timesigLeftMargin));
4615+
4616+ x += segment->extraLeadingSpace ().val () * spatium ();
4617+
4618+ return x;
4619+ }
4620+
45994621}
Original file line number Diff line number Diff line change @@ -279,6 +279,9 @@ class Measure final : public MeasureBase {
279279 void checkTrailer ();
280280 void setStretchedWidth (qreal);
281281 void layoutStaffLines ();
282+
283+ qreal computeFirstSegmentXPosition (Segment* segment);
284+
282285 };
283286
284287} // namespace Ms
You can’t perform that action at this time.
0 commit comments