فهرست منبع

Recenter the pressure canvas if hPa unit is selected

shininghero 1 سال پیش
والد
کامیت
9663a707f5
1فایلهای تغییر یافته به همراه7 افزوده شده و 1 حذف شده
  1. 7 1
      views/General_view.c

+ 7 - 1
views/General_view.c

@@ -141,7 +141,13 @@ static void _draw_heat_index(Canvas* canvas, Sensor* sensor, const uint8_t pos[2
 }
 
 static void _draw_pressure(Canvas* canvas, Sensor* sensor) {
-    const uint8_t x = 29, y = 39;
+    uint8_t x = 29, y = 39;
+    //Slide the canvas over slightly to account for the larger hPa values
+    if(app->settings.pressure_unit == UT_PRESSURE_HPA) {
+        x = 21;
+    } else {
+        x = 29;
+    }
     //Рисование рамки
     if(app->settings.pressure_unit == UT_PRESSURE_HPA) {
         canvas_draw_rframe(canvas, x, y, 84, 20, 3);