Fix text y snapping on rect platforms
This commit is contained in:
+4
-4
@@ -3,7 +3,7 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#define DEBUG_MODE 1
|
||||
// #define DEBUG_MODE 1
|
||||
|
||||
// declare settings-derived statics
|
||||
static uint8_t s_is_jellyfin;
|
||||
@@ -53,7 +53,7 @@ static bool s_sleep_session_found;
|
||||
static bool s_sleep_data_accessible;
|
||||
|
||||
static const uint8_t s_wasted_top_text_pixels = 10; // 10 blank pixels above each line of text
|
||||
static const uint16_t s_available_height = PBL_DISPLAY_HEIGHT - s_sleep_bar_drop - PBL_IF_ROUND_ELSE(MARGIN / 2, MARGIN) + s_wasted_top_text_pixels;
|
||||
static const uint16_t s_available_height = PBL_DISPLAY_HEIGHT - s_sleep_bar_drop - MARGIN / 2 + s_wasted_top_text_pixels;
|
||||
// static const uint8_t s_max_rows = s_available_height / LW_FONT_SIZE;
|
||||
static const uint16_t s_screen_center_y = PBL_DISPLAY_HEIGHT / 2;
|
||||
static const uint16_t s_base_shift = s_screen_center_y - (LW_FONT_SIZE / 2) - (s_wasted_top_text_pixels / 2); // base - perfect if there is one row
|
||||
@@ -68,8 +68,8 @@ static void write_last_watched(const char *text) {
|
||||
|
||||
// if the top extends above the sleep bar, force it below it;
|
||||
// account for blank pixels above text to avoid forcing position when not visually necessary
|
||||
if (y + s_wasted_top_text_pixels < s_sleep_bar_drop + PBL_IF_ROUND_ELSE(MARGIN / 2, MARGIN)) {
|
||||
y = s_sleep_bar_drop + PBL_IF_ROUND_ELSE(MARGIN / 2, MARGIN) - s_wasted_top_text_pixels;
|
||||
if (y + s_wasted_top_text_pixels < s_sleep_bar_drop + MARGIN / 2) {
|
||||
y = s_sleep_bar_drop + MARGIN / 2 - s_wasted_top_text_pixels;
|
||||
#if PBL_DISPLAY_WIDTH >= 260 && PBL_ROUND
|
||||
y += 3;
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user