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,8 +3831,11 @@ void MainWindow::PatternChangesWereSaved(bool saved)
//---------------------------------------------------------------------------------------------------------------------
void MainWindow::DimensionABaseChanged()
{
const qreal oldValue = m_currentDimensionA;
m_currentDimensionA = dimensionA->currentData().toDouble();
if (not VFuzzyComparePossibleNulls(oldValue, m_currentDimensionA))
{
const QList<MeasurementDimension_p> dimensions = m->Dimensions().values();
if (dimensions.size() > 1)
{
@ -3848,29 +3851,39 @@ void MainWindow::DimensionABaseChanged()
m_gradation->start();
}
}
//---------------------------------------------------------------------------------------------------------------------
void MainWindow::DimensionBBaseChanged()
{
const qreal oldValue = m_currentDimensionB;
m_currentDimensionB = dimensionB->currentData().toDouble();
if (not VFuzzyComparePossibleNulls(oldValue, m_currentDimensionB))
{
const QList<MeasurementDimension_p> dimensions = m->Dimensions().values();
if (dimensions.size() > 2)
{
MeasurementDimension_p dimension = dimensions.at(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();
if (not VFuzzyComparePossibleNulls(oldValue, m_currentDimensionC))
{
m_gradation->start();
}
}
//---------------------------------------------------------------------------------------------------------------------
void MainWindow::GradationChanged()