Commits

Trammell Hudson  committed ec09299

sin/cos mixup

  • Participants
  • Parent commits 580422b

Comments (0)

Files changed (1)

File zulu/src/zulu.c

 )
 {
 	(void) me;
+
+	const int w = me->bounds.size.w;
+	const int h = me->bounds.size.h;
+
 	graphics_context_set_stroke_color(ctx, GColorWhite);
 	graphics_context_set_fill_color(ctx, GColorWhite);
-	gpath_draw_outline(ctx, &circle_path);
+
+	// Draw the outline circle
+	graphics_draw_circle(ctx, GPoint(w/2,h/2), w/2-1);
+
+	// Compute the sun up / sun down time and
+	// draw the semi-circle
+	//int sun_up = 64;
+	//int sun_down = 190;
+
+	circle_path.num_points = 90;
+	//circle_path.points = &circle_points[sun_up];
+	gpath_draw_filled(ctx, &circle_path);
 
 #if 0
 	const timezone_t * const tz = container_of(me, timezone_t, layer);
 )
 {
 	(void) ctx;
-	const int w = PEBBLE_SCREEN_WIDTH;
-	const int h = PEBBLE_SCREEN_WIDTH;
+	const int w = PEBBLE_SCREEN_WIDTH - 4;
+	const int h = PEBBLE_SCREEN_WIDTH - 4;
 
 	// Compute the points around the circle
 	for (int i = 0 ; i < NUM_POINTS ; i++)
 		const int s = sin_lookup(angle);
 		const int c = cos_lookup(angle);
 		circle_points[i].x = (w/2) + ((w/2) * s) / 0x10000;
-		circle_points[i].y = (h/2) + ((h/2) * c) / 0x10000;
+		circle_points[i].y = (h/2) - ((h/2) * c) / 0x10000;
 	}
 
 	gpath_init(&circle_path, &circle_info);