Commits

technophobe committed 65b4c3b Draft

adding small marks for odd hours in 24 hour mode

  • Participants
  • Parent commits a7afca2

Comments (0)

Files changed (1)

File th10/src/th10.c

 #include "pebble_fonts.h"
 #include "pebble_th.h"
 
-#define CONFIG_SECOND
+//#define CONFIG_SECOND
 
 
 #define UUID { 0xDD, 0xD6, 0x07, 0x2A, 0x2D, 0x0B, 0x4D, 0x79, 0x99, 0x6D, 0xDC, 0x69, 0xD4, 0x62, 0xB8, 0x5B }
 	{ -3, 84 },
 };
 
+// odd hour ticks when using 24-hour mode
+static GPath odd_minor_tick_path;
+static GPoint odd_minor_tick_points[] = {
+  { -2, 78 },
+  { +2, 78 },
+  { +2, 84 },
+  { -2, 84 }
+};
+
+
 // Non-major ticks around the circle; will be drawn as lines
 static GPath minor_tick_path;
 static GPoint minor_tick_points[] = {
 		{
 			gpath_rotate_to(&major_tick_path, angle);
 			gpath_draw_filled(ctx, &major_tick_path);
-		} else {
+		} else {  // if(use_24hour == 0){ // these seem to interfere with the odd hour marks
 			gpath_rotate_to(&minor_tick_path, angle);
 			gpath_draw_outline(ctx, &minor_tick_path);
 		}
 	}
+  // draw odd hour marks if 24-hour clock mode
+  if(use_24hour) {
+    // increment by 2 since the even hour marks are drawn above
+    for(int hour = 1; hour < 24; hour+=2) {
+      const int angle = (hour * TRIG_MAX_ANGLE) / 24;
+      gpath_rotate_to(&odd_minor_tick_path, angle);
+      gpath_draw_filled(ctx, &odd_minor_tick_path);   // including both commands here
+      //gpath_draw_outline(ctx, &odd_minor_tick_path);  // to experiment with various path widths
+    }
+  }
 
 	// And the large labels
 	graphics_context_set_text_color(ctx, GColorWhite);
 	get_time(&now);
 	use_24hour = clock_is_24h_style();
 
+  if(use_24hour) {
+    GPATH_INIT(&odd_minor_tick_path, odd_minor_tick_points);
+    gpath_move_to(&odd_minor_tick_path, GPoint(W/2,H/2));
+  }
+
 	window_init(&window, "Main");
 	window_stack_push(&window, true);
 	window_set_background_color(&window, GColorBlack);