feat: basic dependency graph cooking, updating viewport

This commit is contained in:
parker
2025-07-07 15:47:10 +01:00
parent 544889c40d
commit a14c9e973c
12 changed files with 96 additions and 21 deletions

View File

@@ -114,6 +114,7 @@ void Network::leftMousePressed(QMouseEvent *event)
else if(QGraphicsItem* clickedNode = itemOfType<NodeGraphic>(clickedItems))
{
nodeMoveDelta_=clickedNode->pos()-view_->mapToScene(event->pos());
std::cout << "move delta: " << nodeMoveDelta_.x() << " " << nodeMoveDelta_.y() << "\n";
state_=State::MOVING_NODE;
moveNodeBuffer.clear();
moveNodeBuffer.push_back(clickedNode);
@@ -190,7 +191,7 @@ void Network::mouseMoved(QMouseEvent *event)
if(state_==State::MOVING_NODE)
{
moveNodes(nodeMoveDelta_+view_->mapToScene(event->pos()));
moveNodes(view_->mapToScene(event->pos())+nodeMoveDelta_);
return;
}

View File

@@ -52,8 +52,6 @@ void SocketGraphic::initBoundingBox()
void SocketGraphic::posChanged(QPointF pos)
{
std::cout << "socket pos changed\n";
//
for(auto* edge : edges_)
{
// edge->setPos(startSocket_->scenePos(), socket->scenePos());