Merged develop into feature

--HG--
branch : feature
This commit is contained in:
BojanKverh 2016-10-24 20:39:37 +02:00
commit cd9b11dbe2
2 changed files with 11 additions and 4 deletions

View file

@ -1002,7 +1002,7 @@ void DialogDetail::EditFormula()
DialogEditWrongFormula dlg(data, NULL_ID, this);
dlg.SetFormula(pleFormula->toPlainText());
dlg.setCheckZero(bCheckZero);
if (dlg.exec() == true)
if (dlg.exec() == QDialog::Accepted)
{
QString qsFormula = dlg.GetFormula();
qsFormula.replace("\n", " ");

View file

@ -420,9 +420,16 @@ void VToolDetail::paint(QPainter *painter, const QStyleOptionGraphicsItem *optio
{
if (scene()->views().count() > 0)
{
QPoint pt0 = scene()->views().at(0)->mapFromScene(0, 0);
QPoint pt = scene()->views().at(0)->mapFromScene(0, 100);
qreal dScale = qSqrt(QPoint::dotProduct(pt - pt0, pt - pt0));
const QPoint pt0 = scene()->views().at(0)->mapFromScene(0, 0);
const QPoint pt = scene()->views().at(0)->mapFromScene(0, 100);
const QPoint p = pt - pt0;
#if QT_VERSION >= QT_VERSION_CHECK(5, 1, 0)
const qreal dScale = qSqrt(QPoint::dotProduct(p, p));
#else
const qreal dScale = qSqrt(p.x() * p.x() + p.y() * p.y());
#endif //QT_VERSION >= QT_VERSION_CHECK(5, 1, 0)
grainLine->SetScale(100/dScale);
//qDebug() << "SCALE" << dScale << 10/dScale;
}