scale subtree with mouse wheel

master
Denes Matetelki 14 years ago
parent 6a075518f5
commit 7d82c1eb34

@ -498,17 +498,23 @@ void GraphWidget::keyPressEvent(QKeyEvent *event)
void GraphWidget::wheelEvent(QWheelEvent *event) void GraphWidget::wheelEvent(QWheelEvent *event)
{ {
if (QApplication::keyboardModifiers() == Qt::ControlModifier) if (QApplication::keyboardModifiers() & Qt::ControlModifier)
{ {
if (m_activeNode) if (!m_activeNode)
{ {
m_activeNode->setScale(pow((double)1.2, event->delta() / 120.0), m_parent->statusBarMsg(tr("No active node."));
sceneRect()); return;
}
if (QApplication::keyboardModifiers() & Qt::ShiftModifier)
{
foreach(Node *node, m_activeNode->subtree())
node->setScale(pow((double)1.2, event->delta() / 120.0),
sceneRect());
} }
else else
{ {
m_parent->statusBarMsg(tr("No active node.")); m_activeNode->setScale(pow((double)1.2, event->delta() / 120.0),
return; sceneRect());
} }
} }
else else

Loading…
Cancel
Save