fix #182211: Time Signature position of numerals not updated when staff size change
This commit is contained in:
parent
c351a0e9ee
commit
f3ad7db520
7 changed files with 3 additions and 77 deletions
|
@ -1042,7 +1042,7 @@ void ChordRest::remove(Element* e)
|
|||
// delete beam if empty
|
||||
//---------------------------------------------------------
|
||||
|
||||
void ChordRest::removeDeleteBeam(bool beamed)
|
||||
void ChordRest::removeDeleteBeam(bool /*beamed*/)
|
||||
{
|
||||
if (_beam) {
|
||||
Beam* b = _beam;
|
||||
|
|
|
@ -795,7 +795,6 @@ void Score::cmdAddTimeSig(Measure* fm, int staffIdx, TimeSig* ts, bool local)
|
|||
nsig->setScore(score);
|
||||
nsig->setTrack(staffIdx * VOICES);
|
||||
nsig->setParent(seg);
|
||||
nsig->setNeedLayout(true);
|
||||
undoAddElement(nsig);
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -1145,7 +1145,6 @@ void Measure::cmdAddStaves(int sStaff, int eStaff, bool createRest)
|
|||
timesig->setTrack(staffIdx * VOICES);
|
||||
timesig->setParent(ts);
|
||||
timesig->setSig(ots->sig(), ots->timeSigType());
|
||||
timesig->setNeedLayout(true);
|
||||
score()->undoAddElement(timesig);
|
||||
if (constructed)
|
||||
delete ots;
|
||||
|
|
|
@ -44,17 +44,6 @@ TimeSig::TimeSig(Score* s)
|
|||
_largeParentheses = false;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------
|
||||
// clone
|
||||
//---------------------------------------------------------
|
||||
|
||||
TimeSig* TimeSig::clone() const
|
||||
{
|
||||
TimeSig* ts = new TimeSig(*this);
|
||||
ts->setNeedLayout(true); // relayout of the ts is needed in parts #24571
|
||||
return ts;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------
|
||||
// mag
|
||||
//---------------------------------------------------------
|
||||
|
@ -73,11 +62,9 @@ void TimeSig::setSig(const Fraction& f, TimeSigType st)
|
|||
{
|
||||
if (!_sig.identical(f)) {
|
||||
_sig = f;
|
||||
_needLayout = true;
|
||||
}
|
||||
if (_timeSigType != st) {
|
||||
_timeSigType = st;
|
||||
_needLayout = true;
|
||||
}
|
||||
customText = false;
|
||||
_largeParentheses = false;
|
||||
|
@ -121,7 +108,6 @@ void TimeSig::setNumeratorString(const QString& a)
|
|||
_numeratorString = a;
|
||||
customText = (_denominatorString != QString::number(_sig.denominator()))
|
||||
|| (_numeratorString != QString::number(_sig.numerator()));
|
||||
_needLayout = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -136,7 +122,6 @@ void TimeSig::setDenominatorString(const QString& a)
|
|||
_denominatorString = a;
|
||||
customText = (_denominatorString != QString::number(_sig.denominator()))
|
||||
|| (_numeratorString != QString::number(_sig.numerator()));
|
||||
_needLayout = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -246,7 +231,6 @@ void TimeSig::read(XmlReader& e)
|
|||
customText = false;
|
||||
}
|
||||
_stretch.reduce();
|
||||
_needLayout = true;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------
|
||||
|
@ -254,16 +238,6 @@ void TimeSig::read(XmlReader& e)
|
|||
//---------------------------------------------------------
|
||||
|
||||
void TimeSig::layout()
|
||||
{
|
||||
if (_needLayout)
|
||||
layout1();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------
|
||||
// layout1
|
||||
//---------------------------------------------------------
|
||||
|
||||
void TimeSig::layout1()
|
||||
{
|
||||
setPos(0.0, 0.0);
|
||||
qreal _spatium = spatium();
|
||||
|
@ -372,8 +346,6 @@ void TimeSig::layout1()
|
|||
addbbox(QRect(pointLargeRightParen.x(), pointLargeRightParen.y() - denRect.height(), _spatium / 2, numRect.height() + denRect.height()));
|
||||
}
|
||||
}
|
||||
|
||||
_needLayout = false;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------
|
||||
|
@ -409,7 +381,6 @@ void TimeSig::setFrom(const TimeSig* ts)
|
|||
_sig = ts->_sig;
|
||||
_stretch = ts->_stretch;
|
||||
customText = ts->customText;
|
||||
_needLayout = true;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------
|
||||
|
@ -505,7 +476,6 @@ bool TimeSig::setProperty(P_ID propertyId, const QVariant& v)
|
|||
return false;
|
||||
break;
|
||||
}
|
||||
_needLayout = true;
|
||||
score()->setLayoutAll(); // TODO
|
||||
setGenerated(false);
|
||||
return true;
|
||||
|
@ -578,20 +548,6 @@ void TimeSig::styleChanged()
|
|||
Element::styleChanged();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------
|
||||
// spatiumChanged
|
||||
//---------------------------------------------------------
|
||||
|
||||
void TimeSig::spatiumChanged(qreal /*oldValue*/, qreal /*newValue*/)
|
||||
{
|
||||
_needLayout = true;
|
||||
}
|
||||
|
||||
void TimeSig::localSpatiumChanged(qreal /*oldValue*/, qreal /*newValue*/)
|
||||
{
|
||||
_needLayout = true;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------
|
||||
// nextElement
|
||||
//---------------------------------------------------------
|
||||
|
|
|
@ -65,7 +65,6 @@ class TimeSig : public Element {
|
|||
TimeSigType _timeSigType;
|
||||
bool _showCourtesySig;
|
||||
bool customText; // if false, sz and sn are calculated from _sig
|
||||
bool _needLayout;
|
||||
bool _largeParentheses;
|
||||
PropertyFlags scaleStyle;
|
||||
|
||||
|
@ -77,7 +76,7 @@ class TimeSig : public Element {
|
|||
QString ssig() const;
|
||||
void setSSig(const QString&);
|
||||
|
||||
virtual TimeSig* clone() const override;
|
||||
virtual TimeSig* clone() const override { return new TimeSig(*this); }
|
||||
virtual ElementType type() const override { return ElementType::TIMESIG; }
|
||||
|
||||
TimeSigType timeSigType() const { return _timeSigType; }
|
||||
|
@ -131,11 +130,6 @@ class TimeSig : public Element {
|
|||
|
||||
bool hasCustomText() const { return customText; }
|
||||
|
||||
virtual void spatiumChanged(qreal /*oldValue*/, qreal /*newValue*/) override;
|
||||
virtual void localSpatiumChanged(qreal /*oldValue*/, qreal /*newValue*/) override;
|
||||
|
||||
void setNeedLayout(bool nl) { _needLayout = nl; }
|
||||
|
||||
const Groups& groups() const { return _groups; }
|
||||
void setGroups(const Groups& e) { _groups = e; }
|
||||
|
||||
|
|
|
@ -2479,17 +2479,6 @@ ChangeStaff::ChangeStaff(Staff* _staff, bool _invisible,
|
|||
hideSystemBarLine = hide;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------
|
||||
// notifyTimeSigs
|
||||
// mark timesigs for layout
|
||||
//---------------------------------------------------------
|
||||
|
||||
static void notifyTimeSigs(void*, Element* e)
|
||||
{
|
||||
if (e->isTimeSig())
|
||||
toTimeSig(e)->setNeedLayout(true);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------
|
||||
// flip
|
||||
//---------------------------------------------------------
|
||||
|
@ -2528,8 +2517,6 @@ void ChangeStaff::flip()
|
|||
staff->score()->setLayoutAll();
|
||||
staff->masterScore()->rebuildMidiMapping();
|
||||
staff->score()->setPlaylistDirty();
|
||||
|
||||
score->scanElements(0, notifyTimeSigs);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------
|
||||
|
@ -2546,7 +2533,6 @@ void ChangeStaffType::flip()
|
|||
|
||||
Score* score = staff->score();
|
||||
score->setLayoutAll();
|
||||
score->scanElements(0, notifyTimeSigs);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------
|
||||
|
@ -2594,14 +2580,6 @@ ChangeStyle::ChangeStyle(Score* s, const MStyle& st)
|
|||
{
|
||||
}
|
||||
|
||||
static void updateTimeSigs(void*, Element* e)
|
||||
{
|
||||
if (e->isTimeSig()) {
|
||||
TimeSig* ts = toTimeSig(e);
|
||||
ts->setNeedLayout(true);
|
||||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------
|
||||
// flip
|
||||
//---------------------------------------------------------
|
||||
|
@ -2614,7 +2592,6 @@ void ChangeStyle::flip()
|
|||
score->cmdConcertPitchChanged(style.value(StyleIdx::concertPitch).toBool(), true);
|
||||
if (score->styleV(StyleIdx::MusicalSymbolFont) != style.value(StyleIdx::MusicalSymbolFont)) {
|
||||
score->setScoreFont(ScoreFont::fontFactory(style.value(StyleIdx::MusicalSymbolFont).toString()));
|
||||
score->scanElements(0, updateTimeSigs);
|
||||
}
|
||||
score->setStyle(style);
|
||||
score->styleChanged();
|
||||
|
|
|
@ -303,6 +303,7 @@ void ScoreView::editKey(QKeyEvent* ev)
|
|||
ed.data.clear();
|
||||
if (curGrip != Grip::NO_GRIP && int(curGrip) < grips)
|
||||
ed.pos = grip[int(curGrip)].center() + delta;
|
||||
|
||||
editObject->score()->startCmd();
|
||||
editObject->startEditDrag(ed);
|
||||
editObject->editDrag(ed);
|
||||
|
|
Loading…
Reference in a new issue