MCPcopy Create free account
hub / github.com/chrxh/alien / leftMouseButtonPressed

Method leftMouseButtonPressed

source/Gui/SimulationInteractionController.cpp:158–186  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

156}
157
158void 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
188void SimulationInteractionController::leftMouseButtonHold(IntVector2D const& mousePos, IntVector2D const& prevMousePos)
189{

Callers

nothing calls this directly

Calls 10

toRealVector2DFunction · 0.85
resetMethod · 0.80
setMotionBlurMethod · 0.80
getMotionBlurMethod · 0.80
onSelectObjectsMethod · 0.80
onDrawingMethod · 0.80
isSimulationRunningMethod · 0.45
setDetachedMethod · 0.45

Tested by

no test coverage detected