Fix regression. Changing dimension value caused an infinite loop.

This commit is contained in:
Roman Telezhynskyi 2021-01-27 19:20:26 +02:00
parent e714999430
commit 63aba8728b
2 changed files with 33 additions and 19 deletions

View File

@ -1,5 +1,6 @@
# Version 0.7.43 (unreleased)
- Improve Windows installer. Avoid crashing on checking if a program is still running.
- Fix regression. Changing dimension value caused an infinite loop.
# Version 0.7.42 Jan 26, 2021
- Fix export of pattern recipe.

View File

@ -3831,45 +3831,58 @@ void MainWindow::PatternChangesWereSaved(bool saved)
//---------------------------------------------------------------------------------------------------------------------
void MainWindow::DimensionABaseChanged()
{
const qreal oldValue = m_currentDimensionA;
m_currentDimensionA = dimensionA->currentData().toDouble();
const QList<MeasurementDimension_p> dimensions = m->Dimensions().values();
if (dimensions.size() > 1)
if (not VFuzzyComparePossibleNulls(oldValue, m_currentDimensionA))
{
MeasurementDimension_p dimension = dimensions.at(1);
InitDimensionGradation(1, dimension, dimensionB);
if (dimensions.size() > 2)
const QList<MeasurementDimension_p> dimensions = m->Dimensions().values();
if (dimensions.size() > 1)
{
dimension = dimensions.at(2);
InitDimensionGradation(2, dimension, dimensionC);
}
}
MeasurementDimension_p dimension = dimensions.at(1);
InitDimensionGradation(1, dimension, dimensionB);
m_gradation->start();
if (dimensions.size() > 2)
{
dimension = dimensions.at(2);
InitDimensionGradation(2, dimension, dimensionC);
}
}
m_gradation->start();
}
}
//---------------------------------------------------------------------------------------------------------------------
void MainWindow::DimensionBBaseChanged()
{
const qreal oldValue = m_currentDimensionB;
m_currentDimensionB = dimensionB->currentData().toDouble();
const QList<MeasurementDimension_p> dimensions = m->Dimensions().values();
if (dimensions.size() > 2)
if (not VFuzzyComparePossibleNulls(oldValue, m_currentDimensionB))
{
MeasurementDimension_p dimension = dimensions.at(2);
InitDimensionGradation(2, dimension, dimensionC);
}
const QList<MeasurementDimension_p> dimensions = m->Dimensions().values();
m_gradation->start();
if (dimensions.size() > 2)
{
const MeasurementDimension_p& dimension = dimensions.at(2);
InitDimensionGradation(2, dimension, dimensionC);
}
m_gradation->start();
}
}
//---------------------------------------------------------------------------------------------------------------------
void MainWindow::DimensionCBaseChanged()
{
const qreal oldValue = m_currentDimensionC;
m_currentDimensionC = dimensionC->currentData().toDouble();
m_gradation->start();
if (not VFuzzyComparePossibleNulls(oldValue, m_currentDimensionC))
{
m_gradation->start();
}
}
//---------------------------------------------------------------------------------------------------------------------