Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 23 additions & 2 deletions src/engraving/rendering/score/slurtielayout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

#include "dom/slur.h"
#include "dom/chord.h"
#include "dom/clef.h"
#include "dom/score.h"
#include "dom/system.h"
#include "dom/staff.h"
Expand Down Expand Up @@ -268,7 +269,7 @@ SpannerSegment* SlurTieLayout::layoutSystem(Slur* item, System* system, LayoutCo
}
}

double endingX = outgoingPartialSlur ? measure->endingXForOpenEndedLines() : system->endingXForOpenEndedLines();
double endingX = endingXForOpenEndedSlurTie(outgoingPartialSlur ? measure : system->lastMeasure(), item->startCR()->vStaffIdx());
p2 = PointF(endingX, y);

// adjust for ties at the end of the system
Expand Down Expand Up @@ -353,6 +354,26 @@ void SlurTieLayout::adjustSlurFloatingEndPointAngles(SlurSegment* slurSeg, Point
}
}

double SlurTieLayout::endingXForOpenEndedSlurTie(const Measure* measure, staff_idx_t staffIdx)
{
double endingX = measure->endingXForOpenEndedLines();

const Segment* clefSeg = measure->findSegmentR(SegmentType::ClefTypes, measure->ticks());
if (!clefSeg || !clefSeg->enabled()) {
return endingX;
}

const Clef* clef = toClef(clefSeg->element(staff2track(staffIdx)));
if (!clef || !clef->addToSkyline()) {
return endingX;
}

const double margin = clef->style().styleAbsolute(Sid::lineEndToBarlineDistance);
const double clefLeftX = measure->x() + clefSeg->x() + clef->ldata()->shape().translated(clef->pos()).left();

return std::min(endingX, clefLeftX - margin);
}

//---------------------------------------------------------
// slurPos
// calculate position of start- and endpoint of slur
Expand Down Expand Up @@ -1562,7 +1583,7 @@ TieSegment* SlurTieLayout::layoutTieFor(Tie* item, System* system)

int segmentCount = sPos.system1 == sPos.system2 ? 1 : 2;
if (segmentCount == 2) {
sPos.p2 = PointF(system->endingXForOpenEndedLines(), sPos.p1.y());
sPos.p2 = PointF(endingXForOpenEndedSlurTie(system->lastMeasure(), item->startNote()->vStaffIdx()), sPos.p1.y());
} else {
sPos.p2 = computeDefaultStartOrEndPoint(item, Grip::END);
}
Expand Down
2 changes: 2 additions & 0 deletions src/engraving/rendering/score/slurtielayout.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ class SlurTieLayout
static bool isOverBeams(Slur* slur);
static double computeShoulderHeight(SlurSegment* slurSeg, double slurLengthInSp, PointF shoulderOffset);

static double endingXForOpenEndedSlurTie(const Measure* measure, staff_idx_t staffIdx);

static bool tieSegmentShouldBeSkipped(const Tie* item);
static void computeStartAndEndSystem(Tie* item, SlurTiePos& slurTiePos);
static PointF computeDefaultStartOrEndPoint(const Tie* tie, Grip startOrEnd);
Expand Down
1 change: 1 addition & 0 deletions src/engraving/rw/read500/tread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3794,6 +3794,7 @@ bool TRead::readProperties(SlurTie* s, XmlReader& e, ReadContext& ctx)
const AsciiStringView tag(e.name());

if (TRead::readProperty(s, tag, e, ctx, Pid::SLUR_DIRECTION)) {
} else if (TRead::readProperty(s, tag, e, ctx, Pid::MASK_SLURTIE)) {
} else if (tag == "lineType") {
s->setStyleType(static_cast<SlurStyleType>(e.readInt()));
} else if (tag == "SlurSegment" || tag == "TieSegment" || tag == "LaissezVibSegment" || tag == "PartialTieSegment"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,17 +102,17 @@ Column {

FlatRadioButtonGroupPropertyView {
id: maskSection
titleText: qsTrc("inspector", "Mask over clefs, key and time signatures")
titleText: qsTrc("propertiespanel", "Mask over clefs, key and time signatures")
propertyItem: root.model ? root.model.maskSlurTie : null

navigationPanel: root.navigationPanel
navigationName: "Mask"
navigationRowStart: tiePlacementSection.navigationRowEnd + 1

model: [
{ text: qsTrc("inspector", "Auto"), value: CommonTypes.AUTO_ON_OFF_AUTO },
{ text: qsTrc("inspector", "On"), value: CommonTypes.AUTO_ON_OFF_ON },
{ text: qsTrc("inspector", "Off"), value: CommonTypes.AUTO_ON_OFF_OFF }
{ text: qsTrc("propertiespanel", "Auto"), value: CommonTypes.AUTO_ON_OFF_AUTO },
{ text: qsTrc("propertiespanel", "On"), value: CommonTypes.AUTO_ON_OFF_ON },
{ text: qsTrc("propertiespanel", "Off"), value: CommonTypes.AUTO_ON_OFF_OFF }
]
}

Expand Down
Loading