| 259 | } |
| 260 | |
| 261 | void SimulationInteractionController::rightMouseButtonHold(IntVector2D const& mousePos, IntVector2D const& prevMousePos) |
| 262 | { |
| 263 | if (_modesAtClick.positionSelectionMode) { |
| 264 | return; |
| 265 | } |
| 266 | |
| 267 | if (!_modesAtClick.editMode) { |
| 268 | Viewport::get().zoom(mousePos, 1.0f / calcZoomFactor(_lastZoomTimepoint ? *_lastZoomTimepoint : std::chrono::steady_clock::now())); |
| 269 | } else { |
| 270 | if (!ImGui::GetIO().KeyAlt) { |
| 271 | auto isSimulationRunning = _simulationFacade->isSimulationRunning(); |
| 272 | if (!isSimulationRunning && !_modesAtClick.drawMode && _selectionRect.has_value()) { |
| 273 | _selectionRect->bottomRight = toRealVector2D(mousePos); |
| 274 | EditorController::get().onUpdateSelectionRect(*_selectionRect); |
| 275 | } |
| 276 | if (isSimulationRunning) { |
| 277 | RealVector2D prevWorldPos = Viewport::get().mapViewToWorldPosition(toRealVector2D(prevMousePos)); |
| 278 | EditorController::get().onApplyForces(toRealVector2D(mousePos), prevWorldPos); |
| 279 | } |
| 280 | } |
| 281 | } |
| 282 | } |
| 283 | |
| 284 | void SimulationInteractionController::mouseWheelDown(IntVector2D const& mousePos, float strongness) |
| 285 | { |
nothing calls this directly
no test coverage detected