Fixed clearing curves

Resolves #1295
This commit is contained in:
Raphael Coeffic
2022-01-04 14:21:07 +10:00
committed by Peter Feerick
parent a077f2e325
commit 44cdb4497f
5 changed files with 146 additions and 120 deletions
+4 -11
View File
@@ -74,19 +74,12 @@ void onCurveOneMenu(const char * result)
POPUP_INPUT(STR_PRESET, runPopupCurvePreset);
}
else if (result == STR_MIRROR) {
CurveHeader & crv = g_model.curves[s_currIdxSubMenu];
int8_t * points = curveAddress(s_currIdxSubMenu);
for (int i=0; i<5+crv.points; i++)
points[i] = -points[i];
curveMirror(s_currIdxSubMenu);
storageDirty(EE_MODEL);
}
else if (result == STR_CLEAR) {
CurveHeader & crv = g_model.curves[s_currIdxSubMenu];
int8_t * points = curveAddress(s_currIdxSubMenu);
for (int i=0; i<5+crv.points; i++)
points[i] = 0;
if (crv.type == CURVE_TYPE_CUSTOM) {
resetCustomCurveX(points, 5+crv.points);
}
curveClear(s_currIdxSubMenu);
storageDirty(EE_MODEL);
}
}