Mercurial > hg > svgui
diff layer/Layer.cpp @ 359:020c485aa7e0
* More work on aligning copy/paste between layers. It's a surprisingly
complicated business.
author | Chris Cannam |
---|---|
date | Wed, 06 Feb 2008 12:49:49 +0000 |
parents | 4f4f38a11cd2 |
children | d58701996fae |
line wrap: on
line diff
--- a/layer/Layer.cpp Mon Feb 04 17:45:16 2008 +0000 +++ b/layer/Layer.cpp Wed Feb 06 12:49:49 2008 +0000 @@ -159,6 +159,30 @@ return true; } +size_t +Layer::alignToReference(View *v, size_t frame) const +{ + const Model *m = getModel(); + std::cerr << "Layer::alignToReference(" << frame << "): model = " << m << ", alignment reference = " << (m ? m->getAlignmentReference() : 0) << std::endl; + if (m && m->getAlignmentReference()) { + return m->alignToReference(frame); + } else { + return v->alignToReference(frame); + } +} + +size_t +Layer::alignFromReference(View *v, size_t frame) const +{ + const Model *m = getModel(); + std::cerr << "Layer::alignFromReference(" << frame << "): model = " << m << ", alignment reference = " << (m ? m->getAlignmentReference() : 0) << std::endl; + if (m && m->getAlignmentReference()) { + return m->alignFromReference(frame); + } else { + return v->alignFromReference(frame); + } +} + bool Layer::MeasureRect::operator<(const MeasureRect &mr) const {