Move fix to a better place

This commit is contained in:
3djc
2017-01-03 11:42:12 +01:00
parent 406a568c2c
commit bdf3d17652
2 changed files with 4 additions and 2 deletions
+2 -2
View File
@@ -58,7 +58,7 @@ void drawTrims(uint8_t flightMode)
drawVerticalSlider(xm, TRIM_V_Y, 160, trim, TRIM_EXTENDED_MIN, TRIM_EXTENDED_MAX, 0, OPTION_SLIDER_EMPTY_BAR|OPTION_SLIDER_TRIM_BUTTON);
}
else {
drawVerticalSlider(xm, TRIM_V_Y, 160, limit(TRIM_MIN, trim, TRIM_MAX), TRIM_MIN, TRIM_MAX, 0, OPTION_SLIDER_EMPTY_BAR|OPTION_SLIDER_TRIM_BUTTON);
drawVerticalSlider(xm, TRIM_V_Y, 160, trim, TRIM_MIN, TRIM_MAX, 0, OPTION_SLIDER_EMPTY_BAR|OPTION_SLIDER_TRIM_BUTTON);
}
if (g_model.displayTrims != DISPLAY_TRIMS_NEVER && trim != 0) {
if (g_model.displayTrims == DISPLAY_TRIMS_ALWAYS || (trimsDisplayTimer > 0 && (trimsDisplayMask & (1<<i)))) {
@@ -72,7 +72,7 @@ void drawTrims(uint8_t flightMode)
drawHorizontalSlider(xm, TRIM_H_Y, 160, trim, TRIM_EXTENDED_MIN, TRIM_EXTENDED_MAX, 0, OPTION_SLIDER_EMPTY_BAR|OPTION_SLIDER_TRIM_BUTTON);
}
else {
drawHorizontalSlider(xm, TRIM_H_Y, 160, limit(TRIM_MIN, trim, TRIM_MAX), TRIM_MIN, TRIM_MAX, 0, OPTION_SLIDER_EMPTY_BAR|OPTION_SLIDER_TRIM_BUTTON);
drawHorizontalSlider(xm, TRIM_H_Y, 160, trim, TRIM_MIN, TRIM_MAX, 0, OPTION_SLIDER_EMPTY_BAR|OPTION_SLIDER_TRIM_BUTTON);
}
if (g_model.displayTrims != DISPLAY_TRIMS_NEVER && trim != 0) {
if (g_model.displayTrims == DISPLAY_TRIMS_ALWAYS || (trimsDisplayTimer > 0 && (trimsDisplayMask & (1<<i)))) {
+2
View File
@@ -212,6 +212,7 @@ void drawVerticalTrimPosition(coord_t x, coord_t y, int16_t dir)
void drawVerticalSlider(coord_t x, coord_t y, int len, int val, int min, int max, uint8_t steps, uint32_t options)
{
val = limit(min, val, max);
if (steps) {
int delta = len / steps;
for (int i = 0; i <= len; i += delta) {
@@ -244,6 +245,7 @@ void drawVerticalSlider(coord_t x, coord_t y, int len, int val, int min, int max
void drawHorizontalSlider(coord_t x, coord_t y, int len, int val, int min, int max, uint8_t steps, uint32_t options)
{
val = limit(min, val, max);
int w = divRoundClosest(len * (val - min), max - min);
if (options & OPTION_SLIDER_TICKS) {
if (steps) {