fix(bw): unable to select GV as source for weight/offset/curve in input/mix (#5386)

This commit is contained in:
philmoz
2024-08-07 20:07:36 +10:00
committed by GitHub
parent 48977acfc4
commit 5e745df8c1
17 changed files with 66 additions and 53 deletions
+5 -4
View File
@@ -164,7 +164,7 @@ void drawSlider(coord_t x, coord_t y, uint8_t value, uint8_t max, uint8_t attr)
uint16_t editSrcVarFieldValue(coord_t x, coord_t y, const char* title, uint16_t value,
int16_t min, int16_t max, LcdFlags attr, event_t event,
IsValueAvailable isValueAvailable, int16_t sourceMin)
IsValueAvailable isValueAvailable, int16_t sourceMin, int16_t sourceMax)
{
if (title)
lcdDrawTextAlignedLeft(y, title);
@@ -173,14 +173,15 @@ uint16_t editSrcVarFieldValue(coord_t x, coord_t y, const char* title, uint16_t
if (v.isSource) {
drawSource(x, y, v.value, attr);
if (attr & (~RIGHT)) {
value = checkIncDec(event, value, sourceMin, MIXSRC_LAST,
value = checkIncDec(event, value, sourceMin, sourceMax,
EE_MODEL|INCDEC_SOURCE|INCDEC_SOURCE_VALUE|INCDEC_SOURCE_INVERT|NO_INCDEC_MARKS, isValueAvailable);
}
} else {
lcdDrawNumber(x, y, v.value, attr);
if (attr & (~RIGHT)) {
value = checkIncDec(event, value, min, max,
EE_MODEL|INCDEC_SOURCE_VALUE|NO_INCDEC_MARKS|(sourceMin == INPUTSRC_FIRST ? INCDEC_SOURCE_NOINPUTS : 0));
value = checkIncDec(event, value, min, max, sourceMin, sourceMax,
EE_MODEL|INCDEC_SOURCE_VALUE|NO_INCDEC_MARKS,
isValueAvailable);
}
}
return value;