diff --git a/common/lc_view.cpp b/common/lc_view.cpp index 2480f7a6..e97661f6 100644 --- a/common/lc_view.cpp +++ b/common/lc_view.cpp @@ -2851,5 +2851,12 @@ void lcView::OnMouseMove() void lcView::OnMouseWheel(float Direction) { - mModel->Zoom(mCamera, (int)(((mMouseModifiers & Qt::ControlModifier) ? 100 : 10) * Direction)); + float Scale = 10.0f; + + if (mMouseModifiers & Qt::ControlModifier) + Scale = 100.0f; + else if (mMouseModifiers & Qt::ShiftModifier) + Scale = 1.0f; + + mModel->Zoom(mCamera, static_cast(Direction * Scale)); } diff --git a/common/lc_viewwidget.cpp b/common/lc_viewwidget.cpp index 206e5428..41c88b66 100644 --- a/common/lc_viewwidget.cpp +++ b/common/lc_viewwidget.cpp @@ -232,13 +232,13 @@ void lcViewWidget::wheelEvent(QWheelEvent* WheelEvent) #endif mView->SetMouseModifiers(WheelEvent->modifiers()); - mWheelAccumulator += WheelEvent->angleDelta().y() / 8; - int numSteps = mWheelAccumulator / 15; + mWheelAccumulator += WheelEvent->angleDelta().y(); + int Steps = mWheelAccumulator / 8; - if (numSteps) + if (Steps) { - mView->OnMouseWheel(numSteps); - mWheelAccumulator -= numSteps * 15; + mView->OnMouseWheel(Steps / 15); + mWheelAccumulator -= Steps * 8; } WheelEvent->accept();