fix #271145: Changing Dynamic Range for hairpins lead to crash
This commit is contained in:
parent
a322ad33cb
commit
47dd40114b
3 changed files with 34 additions and 7 deletions
|
@ -332,7 +332,10 @@ void Glissando::layout()
|
|||
s->layout();
|
||||
return;
|
||||
}
|
||||
|
||||
if (spannerSegments().empty()) {
|
||||
qDebug("no segments");
|
||||
return;
|
||||
}
|
||||
SLine::layout();
|
||||
setPos(0.0, 0.0);
|
||||
adjustReadPos();
|
||||
|
|
|
@ -385,7 +385,15 @@ QVariant HairpinSegment::getProperty(Pid id) const
|
|||
if (spp->pid == id)
|
||||
return spanner()->getProperty(id);
|
||||
}
|
||||
return TextLineBaseSegment::getProperty(id);
|
||||
switch (id) {
|
||||
case Pid::VELO_CHANGE:
|
||||
case Pid::HAIRPIN_TYPE:
|
||||
case Pid::HAIRPIN_CIRCLEDTIP:
|
||||
case Pid::DYNAMIC_RANGE:
|
||||
return spanner()->getProperty(id);
|
||||
default:
|
||||
return TextLineBaseSegment::getProperty(id);
|
||||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------
|
||||
|
@ -398,7 +406,15 @@ bool HairpinSegment::setProperty(Pid id, const QVariant& v)
|
|||
if (spp->pid == id)
|
||||
return spanner()->setProperty(id, v);
|
||||
}
|
||||
return TextLineBaseSegment::setProperty(id, v);
|
||||
switch (id) {
|
||||
case Pid::VELO_CHANGE:
|
||||
case Pid::HAIRPIN_TYPE:
|
||||
case Pid::HAIRPIN_CIRCLEDTIP:
|
||||
case Pid::DYNAMIC_RANGE:
|
||||
return spanner()->setProperty(id, v);
|
||||
default:
|
||||
return TextLineBaseSegment::setProperty(id, v);
|
||||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------
|
||||
|
@ -411,7 +427,15 @@ QVariant HairpinSegment::propertyDefault(Pid id) const
|
|||
if (spp->pid == id)
|
||||
return spanner()->propertyDefault(id);
|
||||
}
|
||||
return TextLineBaseSegment::propertyDefault(id);
|
||||
switch (id) {
|
||||
case Pid::VELO_CHANGE:
|
||||
case Pid::HAIRPIN_TYPE:
|
||||
case Pid::HAIRPIN_CIRCLEDTIP:
|
||||
case Pid::DYNAMIC_RANGE:
|
||||
return spanner()->propertyDefault(id);
|
||||
default:
|
||||
return TextLineBaseSegment::propertyDefault(id);
|
||||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------
|
||||
|
|
|
@ -718,14 +718,14 @@ QPointF SLine::linePos(Grip grip, System** sys) const
|
|||
}
|
||||
break;
|
||||
|
||||
case Spanner::Anchor::NOTE:
|
||||
{
|
||||
case Spanner::Anchor::NOTE: {
|
||||
Element* e = grip == Grip::START ? startElement() : endElement();
|
||||
if (!e)
|
||||
return QPointF();
|
||||
System* s = toNote(e)->chord()->segment()->system();
|
||||
if (s == 0) {
|
||||
qFatal("no system: %s start %s chord parent %s\n", name(), e->name(), toNote(e)->chord()->parent()->name());
|
||||
qDebug("no system: %s start %s chord parent %s\n", name(), e->name(), toNote(e)->chord()->parent()->name());
|
||||
return QPointF();
|
||||
}
|
||||
*sys = s;
|
||||
// return the position of the anchor note relative to the system
|
||||
|
|
Loading…
Reference in a new issue