fix(color): 6POS display on the main and calib. screens (#2684)

* Fix 6POS switch display on the main and calibration screens

* remove unnecessary TRACE()
This commit is contained in:
eshifri
2022-11-06 15:56:38 +10:00
committed by GitHub
parent 8c707cc77c
commit 8caca6b129
2 changed files with 12 additions and 1 deletions
+11 -1
View File
@@ -96,13 +96,23 @@ void MainView6POS::paint(BitmapBuffer * dc)
}
// The square
auto value = 1 + (potsPos[idx] & 0x0f);
value = 1 + (potsPos[idx] & 0x0f);
x = TRIM_SQUARE_SIZE / 2 + divRoundClosest((width() - TRIM_SQUARE_SIZE) * (value -1) , 6);
drawTrimSquare(dc, x, 0, COLOR_THEME_FOCUS);
dc->drawNumber(x + 1, 0, value, FONT(XS) | COLOR_THEME_PRIMARY2);
#endif
}
void MainView6POS::checkEvents()
{
Window::checkEvents();
int16_t newValue = 1 + (potsPos[idx] & 0x0f);
if (value != newValue) {
value = newValue;
invalidate();
}
}
MainViewVerticalSlider::MainViewVerticalSlider(Window* parent, uint8_t idx) :
MainViewSlider(parent, rect_t{}, idx)
{
+1
View File
@@ -73,6 +73,7 @@ class MainView6POS : public MainViewSlider
// using MainViewSlider::MainViewSlider;
MainView6POS(Window* parent, uint8_t idx);
void paint(BitmapBuffer * dc) override;
void checkEvents() override;
};
class MainViewVerticalSlider : public MainViewSlider