- const QRect r = rect();
- pair<Cursor, Cursor> &cursors = _view.cursors();
- cursors.first.paint(p, r);
- cursors.second.paint(p, r);
+ 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());
+ }