void GraphNodeHandler::mouseUp(ci::app::MouseEvent &event) { if (selection == Selection::move) { selection = Selection::none; event.setHandled(true); return; } event.setHandled(false); }
void GraphNodeHandler::mouseDown(ci::app::MouseEvent &event) { if (glm::length(*position - ci::vec2(event.getPos())) < size) { if (event.isAltDown()) { if (selection == Selection::addEdge) { selection = Selection::none; } else { selection = Selection::addEdge; selectedInFrame = ci::app::getElapsedFrames(); } } else { selection = Selection::move; } event.setHandled(true); } else { if (selection == Selection::move) selection = Selection::none; } }
void GraphNodeHandler::mouseDrag(ci::app::MouseEvent &event) { if (selection == Selection::move) { *position = event.getPos(); changed = true; } event.setHandled(selection == Selection::move); }