diff view/View.cpp @ 834:9ad718fdc369

Add getInteractionLayer() and some docs
author Chris Cannam
date Tue, 02 Sep 2014 10:31:23 +0100
parents 8bb9320f78a4
children 7792b7667f74
line wrap: on
line diff
--- a/view/View.cpp	Wed Aug 13 22:03:19 2014 +0100
+++ b/view/View.cpp	Tue Sep 02 10:31:23 2014 +0100
@@ -635,6 +635,26 @@
 }
 
 Layer *
+View::getInteractionLayer()
+{
+    Layer *sl = getSelectedLayer();
+    if (sl && !(sl->isLayerDormant(this))) {
+        return sl;
+    }
+    if (!m_layers.empty()) {
+        int n = getLayerCount();
+        while (n > 0) {
+            --n;
+            Layer *layer = getLayer(n);
+            if (!(layer->isLayerDormant(this))) {
+                return layer;
+            }
+        }
+    }
+    return 0;
+}
+
+Layer *
 View::getSelectedLayer()
 {
     if (m_haveSelectedLayer && !m_layers.empty()) {