Skip to content

Commit

Permalink
issue #479 : wheel events be handled by scrollbars
Browse files Browse the repository at this point in the history
  • Loading branch information
dxli committed Aug 30, 2015
1 parent c71e84a commit f89543a
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions librecad/src/ui/qg_graphicview.cpp
Expand Up @@ -509,8 +509,12 @@ void QG_GraphicView::wheelEvent(QWheelEvent *e) {
RS2::Both, mouse, factor));
} else {
// otherwise, scroll
setCurrentAction(new RS_ActionZoomScroll(numPixels.x(), numPixels.y(),
*container, *this));
//scroll by scrollbars: issue #479
hScrollBar->setValue(hScrollBar->value() - numPixels.x());
vScrollBar->setValue(vScrollBar->value() - numPixels.y());

// setCurrentAction(new RS_ActionZoomScroll(numPixels.x(), numPixels.y(),
// *container, *this));
}
redraw();
}
Expand Down Expand Up @@ -555,8 +559,18 @@ void QG_GraphicView::wheelEvent(QWheelEvent *e) {
}

if (scroll) {
setCurrentAction(new RS_ActionZoomScroll(direction,
*container, *this));
//scroll by scrollbars: issue #479
switch(direction){
case RS2::Left:
case RS2::Right:
hScrollBar->setValue(hScrollBar->value()+e->delta());
break;
default:
vScrollBar->setValue(vScrollBar->value()+e->delta());
}

// setCurrentAction(new RS_ActionZoomScroll(direction,
// *container, *this));
}

// zoom in / out:
Expand Down

0 comments on commit f89543a

Please sign in to comment.