Invert s_first_tick; add comment

This commit is contained in:
2026-04-03 16:19:04 -04:00
parent f0402e9d45
commit db0ed68971

View File

@@ -70,7 +70,7 @@ static GRect s_bt_grect_b;
// declare animation templates // declare animation templates
static const uint8_t s_animation_duration = 255; static const uint8_t s_animation_duration = 255;
static bool s_first_tick = true; static bool s_first_tick_occurred = false;
static Animation *s_head_raise_template; static Animation *s_head_raise_template;
static Animation *s_head_out_template; static Animation *s_head_out_template;
static Animation *s_head_in_template; static Animation *s_head_in_template;
@@ -162,7 +162,7 @@ static void update_minute_1() {
//// calculate new positions //// calculate new positions
s_date_grect_b = GRect(s_ones_offset[ones], s_date_pos_y, s_date_bt_width, s_date_height); s_date_grect_b = GRect(s_ones_offset[ones], s_date_pos_y, s_date_bt_width, s_date_height);
s_bt_grect_b = GRect(s_bt_pos_x - s_ones_offset[ones], s_bt_pos_y, s_date_bt_width, s_bt_height); s_bt_grect_b = GRect(s_bt_pos_x - s_ones_offset[ones], s_bt_pos_y, s_date_bt_width, s_bt_height);
if (!s_first_tick) { if (s_first_tick_occurred) { // no need to animate before first tick, as positions are set in init() without animating
//// configure animations //// configure animations
////// date ////// date
PropertyAnimation *date_center_prop = property_animation_create_layer_frame(text_layer_get_layer(s_date_layer), &s_date_grect_a, &s_date_grect_b); PropertyAnimation *date_center_prop = property_animation_create_layer_frame(text_layer_get_layer(s_date_layer), &s_date_grect_a, &s_date_grect_b);
@@ -242,8 +242,8 @@ static void update_minute_60_out_handler(Animation *animation, bool finished, vo
static void minute_handler(struct tm *tick_time, TimeUnits units_changed) { static void minute_handler(struct tm *tick_time, TimeUnits units_changed) {
update_minute_1(); update_minute_1();
if (s_first_tick) { if (!s_first_tick_occurred) {
s_first_tick = false; s_first_tick_occurred = true;
return; // do not animate part swaps on first tick return; // do not animate part swaps on first tick
} }