Fix updating dimension placeholder for individual measurements.

This commit is contained in:
Roman Telezhynskyi 2020-10-22 19:24:18 +03:00
parent 7a28cbb14a
commit 909c703c46

View File

@ -2121,26 +2121,24 @@ void MainWindow::StoreIndividualMDimensions()
auto StoreDimension = [this, measurements](IMD type) auto StoreDimension = [this, measurements](IMD type)
{ {
const QString name = m->MeasurementForDimension(type); const QString name = m->MeasurementForDimension(type);
if (not name.isEmpty() && measurements.contains(name)) const bool valid = not name.isEmpty() && measurements.contains(name);
switch(type)
{ {
switch(type) case IMD::X:
{ qApp->SetDimensionHeight(valid ? *measurements.value(name)->GetValue() : 0);
case IMD::X: break;
qApp->SetDimensionHeight(*measurements.value(name)->GetValue()); case IMD::Y:
break; qApp->SetDimensionSize(valid ? *measurements.value(name)->GetValue() : 0);
case IMD::Y: break;
qApp->SetDimensionSize(*measurements.value(name)->GetValue()); case IMD::W:
break; qApp->SetDimensionHip(valid ? *measurements.value(name)->GetValue() : 0);
case IMD::W: break;
qApp->SetDimensionHip(*measurements.value(name)->GetValue()); case IMD::Z:
break; qApp->SetDimensionWaist(valid ? *measurements.value(name)->GetValue() : 0);
case IMD::Z: break;
qApp->SetDimensionWaist(*measurements.value(name)->GetValue()); case IMD::N:
break; default:
case IMD::N: break;
default:
break;
}
} }
}; };