diff Discovery/Src/tInfo.c @ 826:a370741a743b Evo_2_23

Bugfix Line order of info screen with flip screen active: In the previous version the order of the line in flipping mode (top to bottom) was 6,5,4,3,2,1 instead of 1,2,3,4,5,6. This effected the compass calibration as well as the sensor info view. The problem was solved by adapting the Y calculation. In addition the size of the SensorInfo screen was corrected to avoid clipping issues in flipped mode.
author Ideenmodellierer
date Wed, 11 Oct 2023 17:49:19 +0200
parents b9f699d2e3d0
children 17d9d6eddd8d
line wrap: on
line diff
--- a/Discovery/Src/tInfo.c	Mon Oct 09 16:50:11 2023 +0200
+++ b/Discovery/Src/tInfo.c	Wed Oct 11 17:49:19 2023 +0200
@@ -309,10 +309,21 @@
     hgfx.WindowX0 = XleftGimpStyle;
     hgfx.WindowX1 = XrightGimpStyle;
     hgfx.WindowY1 = 479 - YtopGimpStyle;
-    if(hgfx.WindowY1 < Font->height)
-        hgfx.WindowY0 = 0;
+
+
+    if(!settingsGetPointer()->FlipDisplay)
+    {
+    	hgfx.WindowY1 = 479 - YtopGimpStyle;
+    	if(hgfx.WindowY1 < Font->height)
+    	        hgfx.WindowY0 = 0;
+    	    else
+    	        hgfx.WindowY0 = hgfx.WindowY1 - Font->height;
+    }
     else
-        hgfx.WindowY0 = hgfx.WindowY1 - Font->height;
+    {
+    	hgfx.WindowY0 = YtopGimpStyle;
+    	hgfx.WindowY1 = YtopGimpStyle + Font->height;
+    }
 
     GFX_write_string_color(Font, &hgfx, text, 0, color);
 }