Wrong scaling in verticalScrollBar.

--HG--
branch : develop
This commit is contained in:
dismine 2013-10-21 12:15:50 +03:00
parent c6ae85b5ac
commit 70901ddb1b

View File

@ -53,14 +53,18 @@ void VMainGraphicsView::scalingTime(qreal x){
qreal factor = 1.0 + qreal(_numScheduledScalings) / 300.0; qreal factor = 1.0 + qreal(_numScheduledScalings) / 300.0;
if (QApplication::keyboardModifiers() == Qt::ControlModifier){// If you press CTRL this code will execute if (QApplication::keyboardModifiers() == Qt::ControlModifier){// If you press CTRL this code will execute
scale(factor, factor); scale(factor, factor);
emit NewFactor(factor);
} else { } else {
if(_numScheduledScalings < 0){ if(_numScheduledScalings < 0){
verticalScrollBar()->setValue(qRound(verticalScrollBar()->value() + factor*3.5)); verticalScrollBar()->setValue(qRound(verticalScrollBar()->value() + factor*3.5));
} else {
verticalScrollBar()->setValue(qRound(verticalScrollBar()->value() - factor*3.5));
}
}
emit NewFactor(factor); emit NewFactor(factor);
} else {
if(verticalScrollBar()->value() > 0){
verticalScrollBar()->setValue(qRound(verticalScrollBar()->value() - factor*3.5));
emit NewFactor(factor);
}
}
}
} }
void VMainGraphicsView::animFinished(){ void VMainGraphicsView::animFinished(){