comparison layer/TextLayer.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 e6362cf5ff1d
comparison
equal deleted inserted replaced
1532:14a162f6870f 1533:37df1530519d
695 to.addPoint(p.withReferenceFrame(alignToReference(v, p.getFrame()))); 695 to.addPoint(p.withReferenceFrame(alignToReference(v, p.getFrame())));
696 } 696 }
697 } 697 }
698 698
699 bool 699 bool
700 TextLayer::paste(LayerGeometryProvider *v, const Clipboard &from, sv_frame_t /* frameOffset */, bool /* interactive */) 700 TextLayer::paste(LayerGeometryProvider *v, const Clipboard &from,
701 sv_frame_t /* frameOffset */, bool /* interactive */)
701 { 702 {
702 auto model = ModelById::getAs<TextModel>(m_model); 703 auto model = ModelById::getAs<TextModel>(m_model);
703 if (!model) return false; 704 if (!model) return false;
704 705
705 const EventVector &points = from.getPoints(); 706 const EventVector &points = from.getPoints();
753 } else { 754 } else {
754 frame = i->getFrame(); 755 frame = i->getFrame();
755 } 756 }
756 } 757 }
757 758
758 Event p = *i; 759 Event p = i->withFrame(frame);
760
759 Event newPoint = p; 761 Event newPoint = p;
760 if (p.hasValue()) { 762 if (p.hasValue()) {
761 newPoint = newPoint.withValue(float((i->getValue() - valueMin) / 763 newPoint = newPoint.withValue(float((i->getValue() - valueMin) /
762 (valueMax - valueMin))); 764 (valueMax - valueMin)));
763 } else { 765 } else {