|
|
@ -416,6 +416,12 @@ void GraphLogic::scaleUp()
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (m_activeNode->scale()+qreal(0.2) > qreal(4))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
emit notification(tr("Too much scaling."));
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool subtree(QApplication::keyboardModifiers() & Qt::ControlModifier &&
|
|
|
|
bool subtree(QApplication::keyboardModifiers() & Qt::ControlModifier &&
|
|
|
|
QApplication::keyboardModifiers() & Qt::ShiftModifier);
|
|
|
|
QApplication::keyboardModifiers() & Qt::ShiftModifier);
|
|
|
|
|
|
|
|
|
|
|
@ -423,23 +429,11 @@ void GraphLogic::scaleUp()
|
|
|
|
context.m_graphLogic = this;
|
|
|
|
context.m_graphLogic = this;
|
|
|
|
context.m_nodeList = &m_nodeList;
|
|
|
|
context.m_nodeList = &m_nodeList;
|
|
|
|
context.m_activeNode = m_activeNode;
|
|
|
|
context.m_activeNode = m_activeNode;
|
|
|
|
context.m_scale = qreal(1.2);
|
|
|
|
context.m_scale = qreal(0.2);
|
|
|
|
context.m_subtree = subtree;
|
|
|
|
context.m_subtree = subtree;
|
|
|
|
|
|
|
|
|
|
|
|
QUndoCommand *scaleNodeCommand = new ScaleNodeCommand(context);
|
|
|
|
QUndoCommand *scaleNodeCommand = new ScaleNodeCommand(context);
|
|
|
|
m_undoStack->push(scaleNodeCommand);
|
|
|
|
m_undoStack->push(scaleNodeCommand);
|
|
|
|
|
|
|
|
|
|
|
|
// if (QApplication::keyboardModifiers() & Qt::ControlModifier &&
|
|
|
|
|
|
|
|
// QApplication::keyboardModifiers() & Qt::ShiftModifier)
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// QList <Node *> nodeList = m_activeNode->subtree();
|
|
|
|
|
|
|
|
// foreach(Node *node, nodeList)
|
|
|
|
|
|
|
|
// node->setScale(qreal(1.2), m_graphWidget->sceneRect());
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// else
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// m_activeNode->setScale(qreal(1.2),m_graphWidget->sceneRect());
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void GraphLogic::scaleDown()
|
|
|
|
void GraphLogic::scaleDown()
|
|
|
@ -450,6 +444,12 @@ void GraphLogic::scaleDown()
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (m_activeNode->scale()-qreal(0.2) < qreal(0.1))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
emit notification(tr("Too much scaling."));
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool subtree(QApplication::keyboardModifiers() & Qt::ControlModifier &&
|
|
|
|
bool subtree(QApplication::keyboardModifiers() & Qt::ControlModifier &&
|
|
|
|
QApplication::keyboardModifiers() & Qt::ShiftModifier);
|
|
|
|
QApplication::keyboardModifiers() & Qt::ShiftModifier);
|
|
|
|
|
|
|
|
|
|
|
@ -457,24 +457,11 @@ void GraphLogic::scaleDown()
|
|
|
|
context.m_graphLogic = this;
|
|
|
|
context.m_graphLogic = this;
|
|
|
|
context.m_nodeList = &m_nodeList;
|
|
|
|
context.m_nodeList = &m_nodeList;
|
|
|
|
context.m_activeNode = m_activeNode;
|
|
|
|
context.m_activeNode = m_activeNode;
|
|
|
|
context.m_scale = qreal(1 / 1.2);
|
|
|
|
context.m_scale = qreal(-0.2);
|
|
|
|
context.m_subtree = subtree;
|
|
|
|
context.m_subtree = subtree;
|
|
|
|
|
|
|
|
|
|
|
|
QUndoCommand *scaleNodeCommand = new ScaleNodeCommand(context);
|
|
|
|
QUndoCommand *scaleNodeCommand = new ScaleNodeCommand(context);
|
|
|
|
m_undoStack->push(scaleNodeCommand);
|
|
|
|
m_undoStack->push(scaleNodeCommand);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// if (QApplication::keyboardModifiers() & Qt::ControlModifier &&
|
|
|
|
|
|
|
|
// QApplication::keyboardModifiers() & Qt::ShiftModifier)
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// QList <Node *> nodeList = m_activeNode->subtree();
|
|
|
|
|
|
|
|
// foreach(Node *node, nodeList)
|
|
|
|
|
|
|
|
// node->setScale(qreal(1 / 1.2),m_graphWidget->sceneRect());
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// else
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// m_activeNode->setScale(qreal(1 / 1.2),m_graphWidget->sceneRect());
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void GraphLogic::nodeColor()
|
|
|
|
void GraphLogic::nodeColor()
|
|
|
|