From b818c0df6b1fa3e6b2902c067b85ced2bd03abf7 Mon Sep 17 00:00:00 2001 From: Bertrand Songis Date: Wed, 23 Dec 2015 19:40:04 +0100 Subject: [PATCH] [Horus] Segfault when a curve goes out of the screen --- radio/src/gui/horus/curves.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/radio/src/gui/horus/curves.cpp b/radio/src/gui/horus/curves.cpp index 4782d2711..5ef0bb886 100644 --- a/radio/src/gui/horus/curves.cpp +++ b/radio/src/gui/horus/curves.cpp @@ -38,7 +38,7 @@ coord_t getCurveYCoord(FnFuncP fn, coord_t x) { - return limit(0, CURVE_CENTER_Y - divRoundClosest(fn(divRoundClosest(x * RESX, CURVE_SIDE_WIDTH)) * CURVE_SIDE_WIDTH, RESX), LCD_H-1); + return limit(CURVE_CENTER_Y-CURVE_SIDE_WIDTH, CURVE_CENTER_Y - divRoundClosest(fn(divRoundClosest(x * RESX, CURVE_SIDE_WIDTH)) * CURVE_SIDE_WIDTH, RESX), CURVE_CENTER_Y+CURVE_SIDE_WIDTH); } void drawFunction(FnFuncP fn, int offset)