Skip to content

Commit 3adc7ed

Browse files
committed
[engraving] remove friend class SlurTieLayout from Tie
1 parent 6ff5f44 commit 3adc7ed

File tree

2 files changed

+17
-18
lines changed

2 files changed

+17
-18
lines changed

src/engraving/layout/v0/slurtielayout.cpp

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1015,17 +1015,17 @@ TieSegment* SlurTieLayout::tieLayoutFor(Tie* item, System* system)
10151015
if (item->slurDirection() == DirectionV::AUTO) {
10161016
bool simpleException = st && st->isSimpleTabStaff();
10171017
if (st && st->isSimpleTabStaff()) {
1018-
item->m_up = isUpVoice(c1->voice());
1018+
item->setUp(isUpVoice(c1->voice()));
10191019
} else {
10201020
if (c1->measure()->hasVoices(c1->staffIdx(), c1->tick(), c1->actualTicks())) {
10211021
// in polyphonic passage, ties go on the stem side
1022-
item->m_up = simpleException ? isUpVoice(c1->voice()) : c1->up();
1022+
item->setUp(simpleException ? isUpVoice(c1->voice()) : c1->up());
10231023
} else {
1024-
item->m_up = !c1->up();
1024+
item->setUp(!c1->up());
10251025
}
10261026
}
10271027
} else {
1028-
item->m_up = item->m_slurDirection == DirectionV::UP ? true : false;
1028+
item->setUp(item->slurDirection() == DirectionV::UP ? true : false);
10291029
}
10301030
item->fixupSegments(1);
10311031
TieSegment* segment = item->segmentAt(0);
@@ -1133,13 +1133,13 @@ void SlurTieLayout::tiePos(Tie* item, SlurPos* sp)
11331133
double x2, y2;
11341134

11351135
if (sc->notes().size() > 1 || (ec && ec->notes().size() > 1)) {
1136-
item->_isInside = true;
1136+
item->setIsInside(true);
11371137
} else {
1138-
item->_isInside = false;
1138+
item->setIsInside(false);
11391139
}
11401140
const double smallInset = item->isInside() ? 0.0 : 0.125; // 1/8 spatium, slight visual adjust so that ties don't hit the center
11411141

1142-
sp->p1 = sc->pos() + sc->segment()->pos() + sc->measure()->pos();
1142+
sp->p1 = sc->pos() + sc->segment()->pos() + sc->measure()->pos();
11431143

11441144
//------p1
11451145
y1 = item->startNote()->pos().y();
@@ -1168,20 +1168,20 @@ void SlurTieLayout::tiePos(Tie* item, SlurPos* sp)
11681168

11691169
// ensure that horizontal ties remain horizontal
11701170
if (isHorizontal) {
1171-
y1 = item->m_up ? std::min(y1, y2) : std::max(y1, y2);
1172-
y2 = item->m_up ? std::min(y1, y2) : std::max(y1, y2);
1171+
y1 = item->up() ? std::min(y1, y2) : std::max(y1, y2);
1172+
y2 = item->up() ? std::min(y1, y2) : std::max(y1, y2);
11731173
}
11741174

1175-
if (item->_isInside) {
1175+
if (item->isInside()) {
11761176
x1 = item->startNote()->pos().x() + hw; // the offset for these will be decided in TieSegment::adjustX()
11771177
} else {
1178-
if (sc->stem() && sc->stem()->visible() && sc->up() && item->m_up) {
1178+
if (sc->stem() && sc->stem()->visible() && sc->up() && item->up()) {
11791179
// usually, outside ties start in the middle of the notehead, but
11801180
// for up-ties on up-stems, we'll start at the end of the notehead
11811181
// to avoid the stem
11821182
x1 = item->startNote()->pos().x() + hw;
11831183
} else {
1184-
x1 = item->startNote()->outsideTieAttachX(item->m_up);
1184+
x1 = item->startNote()->outsideTieAttachX(item->up());
11851185
}
11861186
}
11871187
if (!(item->up() && sc->up())) {
@@ -1201,11 +1201,11 @@ void SlurTieLayout::tiePos(Tie* item, SlurPos* sp)
12011201
if (item->isInside()) {
12021202
x2 = item->endNote()->x();
12031203
} else {
1204-
if (ec->stem() && ec->stem()->visible() && !ec->up() && !item->m_up) {
1204+
if (ec->stem() && ec->stem()->visible() && !ec->up() && !item->up()) {
12051205
// as before, xo should account for stems that could get in the way
12061206
x2 = item->endNote()->x();
12071207
} else {
1208-
x2 = item->endNote()->outsideTieAttachX(item->m_up);
1208+
x2 = item->endNote()->outsideTieAttachX(item->up());
12091209
}
12101210
}
12111211
if (!(!item->up() && !ec->up())) {

src/engraving/libmscore/tie.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,8 @@ class Tie final : public SlurTie
9595

9696
bool isConnectingEqualArticulations() const;
9797

98-
bool isInside() const { return _isInside; }
98+
bool isInside() const { return m_isInside; }
99+
void setIsInside(bool val) { m_isInside = val; }
99100

100101
void calculateDirection();
101102

@@ -110,9 +111,7 @@ class Tie final : public SlurTie
110111

111112
private:
112113

113-
friend class layout::v0::SlurTieLayout;
114-
115-
bool _isInside = false;
114+
bool m_isInside = false;
116115
};
117116
} // namespace mu::engraving
118117
#endif

0 commit comments

Comments
 (0)