Fix text y snapping on rect platforms
This commit is contained in:
+4
-4
@@ -3,7 +3,7 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#define DEBUG_MODE 1
|
// #define DEBUG_MODE 1
|
||||||
|
|
||||||
// declare settings-derived statics
|
// declare settings-derived statics
|
||||||
static uint8_t s_is_jellyfin;
|
static uint8_t s_is_jellyfin;
|
||||||
@@ -53,7 +53,7 @@ static bool s_sleep_session_found;
|
|||||||
static bool s_sleep_data_accessible;
|
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 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 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_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
|
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;
|
// 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
|
// 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)) {
|
if (y + s_wasted_top_text_pixels < s_sleep_bar_drop + MARGIN / 2) {
|
||||||
y = s_sleep_bar_drop + PBL_IF_ROUND_ELSE(MARGIN / 2, MARGIN) - s_wasted_top_text_pixels;
|
y = s_sleep_bar_drop + MARGIN / 2 - s_wasted_top_text_pixels;
|
||||||
#if PBL_DISPLAY_WIDTH >= 260 && PBL_ROUND
|
#if PBL_DISPLAY_WIDTH >= 260 && PBL_ROUND
|
||||||
y += 3;
|
y += 3;
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+1
-1
@@ -14,7 +14,7 @@ Pebble.addEventListener("appmessage", function (dict) {
|
|||||||
|
|
||||||
// report to user if some configuration is missing
|
// report to user if some configuration is missing
|
||||||
if (!cfg || cfg.CLAY_API_HOST == "" || cfg.CLAY_API_KEY == "" || cfg.CLAY_USER == "") {
|
if (!cfg || cfg.CLAY_API_HOST == "" || cfg.CLAY_API_KEY == "" || cfg.CLAY_USER == "") {
|
||||||
Pebble.sendAppMessage({ PKJS_LAST_WATCHED: "SOME APP SETTINGS ARE UNSET AND THIS IS A TEST TO SEE WHAT CAN FIT ON THE SCREEN OF A PR2 IT SEEMS THE TEST IS SOMETHING EVIL MAKE IT LONGER" });
|
Pebble.sendAppMessage({ PKJS_LAST_WATCHED: "SOME APP SETTINGS ARE UNSET" });
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cfg.CLAY_API_IS_JELLYFIN == true) {
|
if (cfg.CLAY_API_IS_JELLYFIN == true) {
|
||||||
|
|||||||
Reference in New Issue
Block a user