ui: Fixed graph nodes not movable
This commit is contained in:
@@ -25,7 +25,10 @@ void QtGraphNodeComponentClickable::nodeMousePressEvent(QGraphicsSceneMouseEvent
|
||||
m_mousePos = Vec2i(event->scenePos().x(), event->scenePos().y());
|
||||
m_mouseMoved = false;
|
||||
|
||||
event->accept();
|
||||
if (event->button() == Qt::MiddleButton)
|
||||
{
|
||||
event->accept();
|
||||
}
|
||||
}
|
||||
|
||||
void QtGraphNodeComponentClickable::nodeMouseMoveEvent(QGraphicsSceneMouseEvent* event)
|
||||
|
||||
@@ -30,11 +30,6 @@ void QtGraphNodeComponentMoveable::nodeMousePressEvent(QGraphicsSceneMouseEvent*
|
||||
|
||||
void QtGraphNodeComponentMoveable::nodeMouseMoveEvent(QGraphicsSceneMouseEvent* event)
|
||||
{
|
||||
if (event->button() != Qt::LeftButton)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
m_graphNode->setPosition(Vec2i(event->scenePos().x() - m_mouseOffset.x, event->scenePos().y() - m_mouseOffset.y));
|
||||
event->accept();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user