Fix calculation a dimension step.

Value for millimeters is to small.
This commit is contained in:
Roman Telezhynskyi 2020-10-05 10:13:44 +03:00
parent a083d2ff18
commit cfe46d97e4

View File

@ -62,19 +62,13 @@ QVector<int> VAbstartMeasurementDimension::ValidSteps() const
}
else if (diff > 0)
{
steps.append(1);
auto AddStep = [&steps, diff](int step)
for (int i=1; i < 9; ++i)
{
const int step = (m_units == Unit::Mm ? i * 10 : i);
if (diff % step == 0)
{
steps.append(step);
}
};
for (int i=2; i < 9; ++i)
{
AddStep(i);
}
}