Mercurial > hg > svgui
diff layer/TimeInstantLayer.cpp @ 1533:37df1530519d
Fix failure to apply new frame when pasting events
author | Chris Cannam |
---|---|
date | Wed, 09 Oct 2019 11:51:19 +0100 |
parents | 36ad3cdabf55 |
children | 4f8c72adbf43 |
line wrap: on
line diff
--- a/layer/TimeInstantLayer.cpp Wed Oct 09 11:33:33 2019 +0100 +++ b/layer/TimeInstantLayer.cpp Wed Oct 09 11:51:19 2019 +0100 @@ -763,7 +763,8 @@ } bool -TimeInstantLayer::paste(LayerGeometryProvider *v, const Clipboard &from, sv_frame_t frameOffset, bool) +TimeInstantLayer::paste(LayerGeometryProvider *v, const Clipboard &from, + sv_frame_t frameOffset, bool) { auto model = ModelById::getAs<SparseOneDimensionalModel>(m_model); if (!model) return false; @@ -817,7 +818,8 @@ else frame = 0; } - Event newPoint = *i; + Event newPoint = i->withFrame(frame); + if (!i->hasLabel() && i->hasValue()) { newPoint = newPoint.withLabel(QString("%1").arg(i->getValue())); }