Просмотр исходного кода

Recenter the pressure canvas if hPa unit is selected

shininghero 1 год назад
Родитель
Сommit
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);