Fix for #4222: On Horus GUI, can't edit X values for < 3-point curves. (#4325)

After looking at the Taranis GUI code, I decided to emulate what that
does, which is just skip over the X coord line in the menu if when
curve type is custom and points is <= 2.
This commit is contained in:
Kelly Byrd
2017-01-28 19:56:54 +01:00
committed by Bertrand Songis
parent dfbdcdba85
commit 7cff468239
+7 -1
View File
@@ -91,7 +91,13 @@ bool menuModelCurveOne(event_t event)
lcdDrawSolidFilledRect(0, MENU_FOOTER_TOP, 250, MENU_FOOTER_HEIGHT, HEADER_BGCOLOR);
if (crv.type==CURVE_TYPE_CUSTOM && menuVerticalPosition == ITEM_CURVE_COORDS1) {
if (menuHorizontalPosition == 0) {
if (crv.points <= -3) { // can't edit X values on custom curves with 2 points.
if (CURSOR_MOVED_RIGHT(event))
(menuHorizontalPosition = 0, menuVerticalPosition += 1);
else
menuVerticalPosition -= 1;
}
else if (menuHorizontalPosition == 0) {
if (CURSOR_MOVED_RIGHT(event))
menuHorizontalPosition = 1;
else