Skip to content

Commit d499729

Browse files
committed
Fix jumps
1 parent e8d3bc3 commit d499729

File tree

3 files changed

+6
-11
lines changed

3 files changed

+6
-11
lines changed

src/engraving/dom/jump.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ Jump::Jump(Measure* parent)
7070
: TextBase(ElementType::JUMP, parent, TextStyleType::REPEAT_RIGHT, ElementFlag::MOVABLE | ElementFlag::SYSTEM | ElementFlag::ON_STAFF)
7171
{
7272
initElementStyle(&jumpStyle);
73-
setLayoutToParentWidth(true);
7473
m_playRepeats = false;
7574
}
7675

src/engraving/dom/jump.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,6 @@ class Jump final : public TextBase
7979
EngravingItem* prevSegmentElement() override;
8080
String accessibleInfo() const override;
8181

82-
void setLayoutToParentWidth(bool v) { m_layoutToParentWidth = v; }
83-
8482
private:
8583
String m_jumpTo;
8684
String m_playUntil;

src/engraving/rendering/score/tlayout.cpp

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3612,33 +3612,31 @@ void TLayout::layoutJump(const Jump* item, Jump::LayoutData* ldata)
36123612

36133613
layoutBaseTextBase(item, ldata);
36143614

3615-
AlignH align = item->align().horizontal;
3615+
AlignH position = item->position();
36163616

36173617
const Measure* measure = toMeasure(item->parentItem());
3618+
double xAdj = measure ? measure->width() : 0.0;
36183619

3619-
bool avoidBarline = item->staffIdx() != 0 && align != AlignH::HCENTER;
3620-
3620+
bool avoidBarline = item->staffIdx() != 0 && position != AlignH::HCENTER;
36213621
if (avoidBarline) {
36223622
bool startRepeat = measure->repeatStart();
36233623
bool endRepeat = measure->repeatEnd();
36243624
staff_idx_t blIdx = item->staffIdx() - 1;
36253625

36263626
const double fontSizeScaleFactor = item->size() / 10.0;
36273627
double padding = (startRepeat || endRepeat) ? 0.0 : 0.5 * item->spatium() * fontSizeScaleFactor;
3628-
double xAdj = 0.0;
36293628

3630-
if (align == AlignH::LEFT) {
3629+
if (position == AlignH::LEFT) {
36313630
const BarLine* bl = startRepeat || !measure->prevMeasure()
36323631
? measure->startBarLine(blIdx) : measure->prevMeasure()->endBarLine(blIdx);
36333632
double blWidth = startRepeat ? bl->width() : 0.0;
36343633
xAdj += padding + blWidth;
3635-
} else if (align == AlignH::RIGHT) {
3634+
} else if (position == AlignH::RIGHT) {
36363635
const BarLine* bl = measure->endBarLine(blIdx);
36373636
xAdj -= bl->width() + padding;
36383637
}
3639-
3640-
ldata->moveX(xAdj);
36413638
}
3639+
ldata->moveX(xAdj);
36423640

36433641
if (item->autoplace()) {
36443642
LD_CONDITION(ldata->isSetPos());

0 commit comments

Comments
 (0)