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:
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user