Fixed trims display depending on stick mode

Resolves #287
This commit is contained in:
Raphael Coeffic
2021-06-23 12:39:47 +02:00
parent 78db9bcdca
commit cdd6d18d29
2 changed files with 6 additions and 5 deletions
+2 -1
View File
@@ -24,7 +24,8 @@
void MainViewTrim::checkEvents()
{
Window::checkEvents();
int8_t newValue = getTrimValue(mixerCurrentFlightMode, idx);
int8_t stickIndex = CONVERT_MODE(idx);
int8_t newValue = getTrimValue(mixerCurrentFlightMode, stickIndex);
if (value != newValue) {
value = newValue;
invalidate();
@@ -286,22 +286,22 @@ void ViewMainDecoration::createTrims()
HORIZONTAL_SLIDERS_WIDTH, 0
};
trims[TRIMS_LH] = new MainViewHorizontalTrim(this, r, 0);
trims[TRIMS_LH] = new MainViewHorizontalTrim(this, r, TRIMS_LH);
r = rect_t {
right() - HORIZONTAL_SLIDERS_WIDTH - HMARGIN, 0,
HORIZONTAL_SLIDERS_WIDTH, 0
};
trims[TRIMS_RH] = new MainViewHorizontalTrim(this, r, 3);
trims[TRIMS_RH] = new MainViewHorizontalTrim(this, r, TRIMS_RH);
r = rect_t {
0, 0, 0,
VERTICAL_SLIDERS_HEIGHT
};
trims[TRIMS_LV] = new MainViewVerticalTrim(this, r, 2);
trims[TRIMS_RV] = new MainViewVerticalTrim(this, r, 1);
trims[TRIMS_LV] = new MainViewVerticalTrim(this, r, TRIMS_LV);
trims[TRIMS_RV] = new MainViewVerticalTrim(this, r, TRIMS_RV);
}
void ViewMainDecoration::createFlightMode()