Mercurial > hg > svgui
comparison layer/TimeValueLayer.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 | a2fbcfeb2572 |
children | 4f8c72adbf43 |
comparison
equal
deleted
inserted
replaced
1532:14a162f6870f | 1533:37df1530519d |
---|---|
1684 to.addPoint(p.withReferenceFrame(alignToReference(v, p.getFrame()))); | 1684 to.addPoint(p.withReferenceFrame(alignToReference(v, p.getFrame()))); |
1685 } | 1685 } |
1686 } | 1686 } |
1687 | 1687 |
1688 bool | 1688 bool |
1689 TimeValueLayer::paste(LayerGeometryProvider *v, const Clipboard &from, sv_frame_t /* frameOffset */, | 1689 TimeValueLayer::paste(LayerGeometryProvider *v, const Clipboard &from, |
1690 bool interactive) | 1690 sv_frame_t /* frameOffset */, bool interactive) |
1691 { | 1691 { |
1692 auto model = ModelById::getAs<SparseTimeValueModel>(m_model); | 1692 auto model = ModelById::getAs<SparseTimeValueModel>(m_model); |
1693 if (!model) return false; | 1693 if (!model) return false; |
1694 | 1694 |
1695 EventVector points = from.getPoints(); | 1695 EventVector points = from.getPoints(); |
1840 } else { | 1840 } else { |
1841 frame = i->getFrame(); | 1841 frame = i->getFrame(); |
1842 } | 1842 } |
1843 } | 1843 } |
1844 | 1844 |
1845 Event newPoint = *i; | 1845 Event newPoint = i->withFrame(frame); |
1846 | |
1846 if (!i->hasLabel() && i->hasValue()) { | 1847 if (!i->hasLabel() && i->hasValue()) { |
1847 newPoint = newPoint.withLabel(QString("%1").arg(i->getValue())); | 1848 newPoint = newPoint.withLabel(QString("%1").arg(i->getValue())); |
1848 } | 1849 } |
1849 | 1850 |
1850 bool usePrev = false; | 1851 bool usePrev = false; |