diff view/Pane.cpp @ 1376:5a051ca3170e

Merge from branch zoom
author Chris Cannam
date Tue, 06 Nov 2018 11:13:13 +0000
parents 694004228ab7
children 81dda64a7edc
line wrap: on
line diff
--- a/view/Pane.cpp	Mon Nov 05 13:30:21 2018 +0000
+++ b/view/Pane.cpp	Tue Nov 06 11:13:13 2018 +0000
@@ -750,11 +750,8 @@
 void
 Pane::drawModelTimeExtents(QRect r, QPainter &paint, const Model *model)
 {
-    int x0 = getXForFrame(model->getStartFrame());
-    int x1 = getXForFrame(model->getEndFrame());
-
     paint.save();
-
+    
     QBrush brush;
 
     if (hasLightBackground()) {
@@ -765,14 +762,24 @@
         paint.setPen(Qt::white);
     }
 
-    if (x0 > r.x()) {
-        paint.fillRect(0, 0, x0, height(), brush);
-        paint.drawLine(x0, 0, x0, height());
+    sv_frame_t f0 = model->getStartFrame();
+
+    if (f0 > getStartFrame() && f0 < getEndFrame()) {
+        int x0 = getXForFrame(f0);
+        if (x0 > r.x()) {
+            paint.fillRect(0, 0, x0, height(), brush);
+            paint.drawLine(x0, 0, x0, height());
+        }
     }
 
-    if (x1 < r.x() + r.width()) {
-        paint.fillRect(x1, 0, width() - x1, height(), brush);
-        paint.drawLine(x1, 0, x1, height());
+    sv_frame_t f1 = model->getEndFrame();
+    
+    if (f1 > getStartFrame() && f1 < getEndFrame()) {
+        int x1 = getXForFrame(f1);
+        if (x1 < r.x() + r.width()) {
+            paint.fillRect(x1, 0, width() - x1, height(), brush);
+            paint.drawLine(x1, 0, x1, height());
+        }
     }
 
     paint.restore();