| 303 | } |
| 304 | |
| 305 | void SimulationInteractionController::processMouseWheel(IntVector2D const& mousePos) |
| 306 | { |
| 307 | if (_mouseWheelAction) { |
| 308 | auto zoomFactor = powf(calcZoomFactor(_mouseWheelAction->lastTime), 2.2f * _mouseWheelAction->strongness); |
| 309 | auto now = std::chrono::steady_clock::now(); |
| 310 | _mouseWheelAction->lastTime = now; |
| 311 | Viewport::get().zoom(mousePos, _mouseWheelAction->up ? zoomFactor : 1.0f / zoomFactor); |
| 312 | if (std::chrono::duration_cast<std::chrono::milliseconds>(now - _mouseWheelAction->start).count() > 100) { |
| 313 | _mouseWheelAction.reset(); |
| 314 | } |
| 315 | } |
| 316 | } |
| 317 | |
| 318 | void SimulationInteractionController::middleMouseButtonPressed(IntVector2D const& mousePos) |
| 319 | { |