| 156 | } |
| 157 | |
| 158 | void SimulationInteractionController::leftMouseButtonPressed(IntVector2D const& mousePos) |
| 159 | { |
| 160 | _modesAtClick = _modes; |
| 161 | |
| 162 | if (_modes.positionSelectionMode) { |
| 163 | _modes.positionSelectionMode = false; |
| 164 | return; |
| 165 | } |
| 166 | |
| 167 | if (!_modes.editMode) { |
| 168 | _lastZoomTimepoint.reset(); |
| 169 | SimulationView::get().setMotionBlur(SimulationView::get().getMotionBlur() * 2); |
| 170 | } else { |
| 171 | if (!ImGui::GetIO().KeyAlt) { |
| 172 | if (!_modes.drawMode) { |
| 173 | EditorController::get().onSelectObjects(toRealVector2D(mousePos), ImGui::GetIO().KeyCtrl); |
| 174 | _worldPosOnClick = Viewport::get().mapViewToWorldPosition(toRealVector2D(mousePos)); |
| 175 | if (_simulationFacade->isSimulationRunning()) { |
| 176 | _simulationFacade->setDetached(true); |
| 177 | } |
| 178 | |
| 179 | auto shallowData = _simulationFacade->getSelectionShallowData(); |
| 180 | _selectionPositionOnClick = {shallowData.centerPosX, shallowData.centerPosY}; |
| 181 | } else { |
| 182 | CreatorWindow::get().onDrawing(); |
| 183 | } |
| 184 | } |
| 185 | } |
| 186 | } |
| 187 | |
| 188 | void SimulationInteractionController::leftMouseButtonHold(IntVector2D const& mousePos, IntVector2D const& prevMousePos) |
| 189 | { |
nothing calls this directly
no test coverage detected