comparison 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
comparison
equal deleted inserted replaced
358:8b69f36c74be 359:020c485aa7e0
157 } 157 }
158 diff = fabsf(v1 - v0); 158 diff = fabsf(v1 - v0);
159 return true; 159 return true;
160 } 160 }
161 161
162 size_t
163 Layer::alignToReference(View *v, size_t frame) const
164 {
165 const Model *m = getModel();
166 std::cerr << "Layer::alignToReference(" << frame << "): model = " << m << ", alignment reference = " << (m ? m->getAlignmentReference() : 0) << std::endl;
167 if (m && m->getAlignmentReference()) {
168 return m->alignToReference(frame);
169 } else {
170 return v->alignToReference(frame);
171 }
172 }
173
174 size_t
175 Layer::alignFromReference(View *v, size_t frame) const
176 {
177 const Model *m = getModel();
178 std::cerr << "Layer::alignFromReference(" << frame << "): model = " << m << ", alignment reference = " << (m ? m->getAlignmentReference() : 0) << std::endl;
179 if (m && m->getAlignmentReference()) {
180 return m->alignFromReference(frame);
181 } else {
182 return v->alignFromReference(frame);
183 }
184 }
185
162 bool 186 bool
163 Layer::MeasureRect::operator<(const MeasureRect &mr) const 187 Layer::MeasureRect::operator<(const MeasureRect &mr) const
164 { 188 {
165 if (haveFrames) { 189 if (haveFrames) {
166 if (startFrame == mr.startFrame) { 190 if (startFrame == mr.startFrame) {