return h;
}
-void Viewport::paintEvent(QPaintEvent *event)
+void Viewport::paintEvent(QPaintEvent*)
{
const vector< shared_ptr<Signal> > sigs(
_view.session().get_signals());
BOOST_FOREACH(const shared_ptr<Signal> s, sigs)
{
assert(s);
-
- const QRect signal_rect(0, s->get_v_offset() - v_offset,
- width(), View::SignalHeight);
-
- s->paint(p, signal_rect, _view.scale(), _view.offset());
+ s->paint(p, s->get_v_offset() - v_offset, 0, width(),
+ _view.scale(), _view.offset());
}
draw_cursors_foreground(p);
}
}
-void Viewport::mouseReleaseEvent(QMouseEvent *event)
-{
- assert(event);
-}
-
void Viewport::wheelEvent(QWheelEvent *event)
{
assert(event);
if (event->orientation() == Qt::Vertical) {
// Vertical scrolling is interpreted as zooming in/out
_view.zoom(event->delta() / 120, event->x());
+ } else if (event->orientation() == Qt::Horizontal) {
+ // Horizontal scrolling is interpreted as moving left/right
+ _view.set_scale_offset(_view.scale(),
+ event->delta() * _view.scale()
+ + _view.offset());
}
}