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

Method onUpdateSelectionRect

source/Gui/EditorController.cpp:307–316  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

305}
306
307void EditorController::onUpdateSelectionRect(RealRect const& rect)
308{
309 auto startPos = Viewport::get().mapViewToWorldPosition(rect.topLeft);
310 auto endPos = Viewport::get().mapViewToWorldPosition(rect.bottomRight);
311 auto topLeft = RealVector2D{std::min(startPos.x, endPos.x), std::min(startPos.y, endPos.y)};
312 auto bottomRight = RealVector2D{std::max(startPos.x, endPos.x), std::max(startPos.y, endPos.y)};
313
314 _simulationFacade->setSelection(topLeft, bottomRight);
315 EditorModel::get().update();
316}

Callers 1

rightMouseButtonHoldMethod · 0.80

Calls 3

setSelectionMethod · 0.45
updateMethod · 0.45

Tested by

no test coverage detected