-void Viewport::draw_cursors_background(QPainter &p)
-{
- if (!_view.cursors_shown())
- return;
-
- p.setPen(Qt::NoPen);
- p.setBrush(QBrush(View::CursorAreaColour));
-
- const CursorPair &c = _view.cursors();
- const float x1 = (c.first().time() - _view.offset()) / _view.scale();
- const float x2 = (c.second().time() - _view.offset()) / _view.scale();
- const int l = (int)max(min(x1, x2), 0.0f);
- const int r = (int)min(max(x1, x2), (float)width());
-
- p.drawRect(l, 0, r - l, height());
-}
-
-void Viewport::draw_cursors_foreground(QPainter &p)