diff view/View.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 9aab6bd27fcc
children a9dfa2d6d5ac
line wrap: on
line diff
--- a/view/View.cpp	Mon Feb 04 17:45:16 2008 +0000
+++ b/view/View.cpp	Wed Feb 06 12:49:49 2008 +0000
@@ -1120,6 +1120,7 @@
     }
 
     Model *anyModel = 0;
+    Model *alignedModel = 0;
     Model *goodModel = 0;
 
     for (LayerList::const_iterator i = m_layers.begin();
@@ -1133,8 +1134,10 @@
         Model *model = (*i)->getModel();
         if (!model) continue;
 
+        anyModel = model;
+
         if (model->getAlignmentReference()) {
-            anyModel = model;
+            alignedModel = model;
             if (layer->isLayerOpaque() ||
                 dynamic_cast<RangeSummarisableTimeValueModel *>(model)) {
                 goodModel = model;
@@ -1143,6 +1146,7 @@
     }
 
     if (goodModel) return goodModel;
+    else if (alignedModel) return alignedModel;
     else return anyModel;
 }