diff layer/NoteLayer.cpp @ 1317:c2fa7bb1eca9 import-audio-data

Merge from default branch
author Chris Cannam
date Tue, 04 Sep 2018 13:19:32 +0100
parents 1d7921b1852f
children c39f2d439d59
line wrap: on
line diff
--- a/layer/NoteLayer.cpp	Thu Jun 28 14:49:00 2018 +0100
+++ b/layer/NoteLayer.cpp	Tue Sep 04 13:19:32 2018 +0100
@@ -61,7 +61,7 @@
     m_scaleMinimum(0),
     m_scaleMaximum(0)
 {
-          SVDEBUG << "constructed NoteLayer" << endl;
+    SVDEBUG << "constructed NoteLayer" << endl;
 }
 
 void
@@ -833,14 +833,18 @@
 int
 NoteLayer::getVerticalScaleWidth(LayerGeometryProvider *v, bool, QPainter &paint) const
 {
-    if (!m_model || shouldAutoAlign()) {
+    if (!m_model) {
         return 0;
-    } else  {
-        if (m_verticalScale == LogScale || m_verticalScale == MIDIRangeScale) {
-            return LogNumericalScale().getWidth(v, paint) + 10; // for piano
-        } else {
-            return LinearNumericalScale().getWidth(v, paint);
-        }
+    }
+
+    if (shouldAutoAlign() && !valueExtentsMatchMine(v)) {
+        return 0;
+    }
+
+    if (m_verticalScale == LogScale || m_verticalScale == MIDIRangeScale) {
+        return LogNumericalScale().getWidth(v, paint) + 10; // for piano
+    } else {
+        return LinearNumericalScale().getWidth(v, paint);
     }
 }