fix: network zoom

This commit is contained in:
parker
2025-06-20 01:59:39 +01:00
parent be9f3e27ea
commit 9a7458f2c0
4 changed files with 20 additions and 22 deletions

View File

@@ -4,25 +4,9 @@
#include <iostream>
#include <qgraphicsview.h>
NetworkGraphicsScene::NetworkGraphicsScene(QGraphicsView *parent)
NetworkGraphicsScene::NetworkGraphicsScene()
: QGraphicsScene()
{
parent_ = parent;
}
void NetworkGraphicsScene::wheelEvent(QGraphicsSceneWheelEvent *wheelEvent)
{
std::cout << "delta: " << wheelEvent->delta() << "\n";
int delta = wheelEvent->delta();
if(delta > 0)
{
parent_->scale(1.1, 1.1);
}
else if(delta < 0)
{
parent_->scale(0.9, 0.9);
}
wheelEvent->accept();
}