Esempio n. 1
0
void GraphNodeHandler::mouseUp(ci::app::MouseEvent &event)
{
    if (selection == Selection::move)
    {
        selection = Selection::none;
        event.setHandled(true);
        return;
    }
    event.setHandled(false);
}
Esempio n. 2
0
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;
    }
}
Esempio n. 3
0
void GraphNodeHandler::mouseDrag(ci::app::MouseEvent &event)
{
    if (selection == Selection::move)
    {
        *position = event.getPos();
		changed = true;
    }
    event.setHandled(selection == Selection::move);
}