Reset logical switch v2 range if v1 changes (PR #383)

* Reset logical switch v2 range if v1 changes
Use the v1 handler to update v2 range if the v2 source box has already
been created, so that the min/max values are updated from the default.

* Move invalidate, add bounds checking for v2 range

* Out of range check doesn't need to be inclusive

* Remove range check as is inconsistent with buggy B&W behaviour
This commit is contained in:
Peter Feerick
2021-07-05 09:04:06 +10:00
committed by GitHub
parent 797c3f175a
commit 6ded23f26b
@@ -161,7 +161,14 @@ class LogicalSwitchEditPage: public Page
[=](int32_t newValue) {
cs->v1 = newValue;
SET_DIRTY();
v2Edit->invalidate();
if (v2Edit != nullptr)
{
int16_t v2_min = 0, v2_max = 0;
getMixSrcRange(cs->v1, v2_min, v2_max);
v2Edit->setMin(v2_min);
v2Edit->setMax(v2_max);
v2Edit->invalidate();
}
});
grid.nextLine();