fix(color): crash when changing 'Mode' for 'Adjust' SF (#5219)
This commit is contained in:
@@ -517,7 +517,13 @@ void FunctionEditPage::updateSpecialFunctionOneWindow()
|
||||
new StaticText(line, rect_t{}, STR_MODE);
|
||||
auto modechoice = new Choice(line, rect_t{}, FUNC_ADJUST_GVAR_CONSTANT,
|
||||
FUNC_ADJUST_GVAR_INCDEC,
|
||||
GET_DEFAULT(CFN_GVAR_MODE(cfn)), nullptr);
|
||||
GET_DEFAULT(CFN_GVAR_MODE(cfn)),
|
||||
[=](int32_t newValue) {
|
||||
CFN_GVAR_MODE(cfn) = newValue;
|
||||
CFN_PARAM(cfn) = 0;
|
||||
SET_DIRTY();
|
||||
updateSpecialFunctionOneWindow();
|
||||
});
|
||||
line = specialFunctionOneWindow->newLine(grid);
|
||||
|
||||
modechoice->setTextHandler([](int32_t value) {
|
||||
@@ -534,13 +540,6 @@ void FunctionEditPage::updateSpecialFunctionOneWindow()
|
||||
return std::string("---");
|
||||
});
|
||||
|
||||
modechoice->setSetValueHandler([=](int32_t newValue) {
|
||||
CFN_GVAR_MODE(cfn) = newValue;
|
||||
CFN_PARAM(cfn) = 0;
|
||||
SET_DIRTY();
|
||||
updateSpecialFunctionOneWindow();
|
||||
});
|
||||
|
||||
switch (CFN_GVAR_MODE(cfn)) {
|
||||
case FUNC_ADJUST_GVAR_CONSTANT: {
|
||||
int16_t val_min, val_max;
|
||||
|
||||
Reference in New Issue
Block a user