Skip to content

Commit 8a3a8ee

Browse files
committed
Update shapes_digital_clock.c
1 parent 533c12c commit 8a3a8ee

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

examples/shapes/shapes_digital_clock.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,15 @@ int main(void)
6161
//--------------------------------------------------------------------------------------
6262
const int screenWidth = 800;
6363
const int screenHeight = 450;
64-
64+
6565
InitWindow(screenWidth, screenHeight, "raylib [shapes] example - digital clock");
6666

6767
// Initialize clock
6868
Clock myClock = {
6969
.mode = MODE_NORMAL,
7070

7171
.second.angle = 45,
72-
.second.length = 140,
72+
.second.length = 140,
7373
.second.thickness = 3,
7474
.second.color = BEIGE,
7575

@@ -104,11 +104,11 @@ int main(void)
104104
// Draw
105105
//----------------------------------------------------------------------------------
106106
BeginDrawing();
107-
107+
108108
ClearBackground(RAYWHITE);
109109

110110
DrawCircle(400, 225, 5, BLACK); // Clock center dot
111-
111+
112112
DrawClock(myClock, (Vector2){ 400, 225 }); // Clock in selected mode
113113

114114
DrawText("Press [SPACE] to switch clock mode", 10, 10, 20, DARKGRAY);
@@ -138,7 +138,7 @@ static void UpdateClock(Clock *clock)
138138
time(&rawtime);
139139
timeinfo = localtime(&rawtime);
140140

141-
// Updating time data
141+
// Updating time data
142142
clock->second.value = timeinfo->tm_sec;
143143
clock->minute.value = timeinfo->tm_min;
144144
clock->hour.value = timeinfo->tm_hour;
@@ -150,7 +150,7 @@ static void UpdateClock(Clock *clock)
150150
clock->minute.angle = (timeinfo->tm_min%60)*6.0f;
151151
clock->minute.angle += (timeinfo->tm_sec%60)*6/60.0f;
152152
clock->minute.angle -= 90;
153-
153+
154154
clock->second.angle = (timeinfo->tm_sec%60)*6.0f;
155155
clock->second.angle -= 90;
156156
}
@@ -161,7 +161,7 @@ static void DrawClock(Clock clock, Vector2 centerPosition)
161161
if (clock.mode == MODE_HANDS_FREE)
162162
{
163163
DrawCircleLinesV(centerPosition, clock.minute.length, LIGHTGRAY);
164-
164+
165165
DrawText(TextFormat("%i", clock.second.value), centerPosition.x + (clock.second.length - 10)*cosf(clock.second.angle*(float)(PI/180)) - DIGIT_SIZE/2, centerPosition.y + clock.second.length*sinf(clock.second.angle*(float)(PI/180)) - DIGIT_SIZE/2, DIGIT_SIZE, GRAY);
166166

167167
DrawText(TextFormat("%i", clock.minute.value), clock.minute.origin.x + clock.minute.length*cosf(clock.minute.angle*(float)(PI/180)) - DIGIT_SIZE/2, centerPosition.y + clock.minute.length*sinf(clock.minute.angle*(float)(PI/180)) - DIGIT_SIZE/2, DIGIT_SIZE, RED);
@@ -171,11 +171,11 @@ static void DrawClock(Clock clock, Vector2 centerPosition)
171171
else if (clock.mode == MODE_NORMAL)
172172
{
173173
// Draw hand seconds
174-
DrawRectanglePro((Rectangle){ centerPosition.x, centerPosition.y, clock.second.length, clock.second.thickness },
174+
DrawRectanglePro((Rectangle){ centerPosition.x, centerPosition.y, clock.second.length, clock.second.thickness },
175175
(Vector2){ 0.0f, clock.second.thickness/2.0f }, clock.second.angle, clock.second.color);
176176

177177
// Draw hand minutes
178-
DrawRectanglePro((Rectangle){ centerPosition.x, centerPosition.y, clock.minute.length, clock.minute.thickness },
178+
DrawRectanglePro((Rectangle){ centerPosition.x, centerPosition.y, clock.minute.length, clock.minute.thickness },
179179
(Vector2){ 0.0f, clock.minute.thickness/2.0f }, clock.minute.angle, clock.minute.color);
180180

181181
// Draw hand hours

0 commit comments

Comments
 (0)