Skip to content

Commit

Permalink
fix #98756: Scaling of symbols in part set to scaling of full score
Browse files Browse the repository at this point in the history
  • Loading branch information
lasconic committed Feb 19, 2016
1 parent cdedb21 commit 5c4ddcf
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 25 deletions.
2 changes: 1 addition & 1 deletion libmscore/chord.h
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ class Chord : public ChordRest {
void toGraceAfter();
virtual void scanElements(void* data, void (*func)(void*, Element*), bool all=true);

virtual void setTrack(int val);
virtual void setTrack(int val) override;

void computeUp();

Expand Down
62 changes: 39 additions & 23 deletions libmscore/chordrest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1116,29 +1116,6 @@ QString ChordRest::durationUserName()
return QString("%1%2").arg(tupletType).arg(dotString);
}

//---------------------------------------------------------
// setTrack
//---------------------------------------------------------

void ChordRest::setTrack(int val)
{
foreach(Articulation* a, _articulations)
a->setTrack(val);
Element::setTrack(val);
if (type() == Element::Type::CHORD) {
foreach(Note* n, static_cast<Chord*>(this)->notes())
n->setTrack(val);
}
if (_beam)
_beam->setTrack(val);
foreach(Lyrics* l, _lyricsList) {
if (l)
l->setTrack(val);
}
if (tuplet())
tuplet()->setTrack(val);
}

//---------------------------------------------------------
// tick
//---------------------------------------------------------
Expand Down Expand Up @@ -1378,6 +1355,45 @@ Segment* ChordRest::nextSegmentAfterCR(Segment::Type types) const
return 0;
}

//---------------------------------------------------------
// setTrack
//---------------------------------------------------------

void ChordRest::setTrack(int val)
{
Element::setTrack(val);
processSiblings([val] (Element* e) { e->setTrack(val); } );
}

//---------------------------------------------------------
// setScore
//---------------------------------------------------------

void ChordRest::setScore(Score* s)
{
Element::setScore(s);
processSiblings([s] (Element* e) { e->setScore(s); } );
}

//---------------------------------------------------------
// processSiblings
//---------------------------------------------------------

void ChordRest::processSiblings(std::function<void(Element*)> func)
{
if (_beam)
func(_beam);
for (Articulation* a : _articulations)
func(a);
if (_tabDur)
func(_tabDur);
for (Lyrics* l : _lyricsList)
if (l)
func(l);
if (tuplet())
func(tuplet());
}

//---------------------------------------------------------
// nextElement
//---------------------------------------------------------
Expand Down
5 changes: 4 additions & 1 deletion libmscore/chordrest.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ class ChordRest : public DurationElement {
TDuration _durationType;
int _staffMove; // -1, 0, +1, used for crossbeaming

void processSiblings(std::function<void(Element*)> func);

protected:
QList<Articulation*> _articulations;
Beam* _beam;
Expand Down Expand Up @@ -140,7 +142,7 @@ class ChordRest : public DurationElement {
: _durationType.ticks(); }
QString durationUserName();

virtual void setTrack(int val);
virtual void setTrack(int val) override;
virtual int tick() const;
virtual int rtick() const;
virtual Space space() const { return _space; }
Expand Down Expand Up @@ -169,6 +171,7 @@ class ChordRest : public DurationElement {
void writeBeam(Xml& xml);
Segment* nextSegmentAfterCR(Segment::Type types) const;

virtual void setScore(Score* s) override;
virtual Element* nextElement() override;
virtual Element* prevElement() override;
virtual QString accessibleExtraInfo() override;
Expand Down
4 changes: 4 additions & 0 deletions libmscore/note.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2533,6 +2533,10 @@ void Note::setScore(Score* s)
Element::setScore(s);
if (_tieFor)
_tieFor->setScore(s);
if (_accidental)
_accidental->setScore(s);
for (Element* el : _el)
el->setScore(s);
}

//---------------------------------------------------------
Expand Down

0 comments on commit 5c4ddcf

Please sign in to comment.