From daeccd03ace3eacf7907ecca1a697c7d00961cf4 Mon Sep 17 00:00:00 2001 From: Jeffery Myers Date: Mon, 25 Oct 2021 01:21:16 -0700 Subject: Fix VC warnings for examples (#2085) --- examples/text/text_input_box.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'examples/text') diff --git a/examples/text/text_input_box.c b/examples/text/text_input_box.c index aeea4e15..2e7d9a55 100644 --- a/examples/text/text_input_box.c +++ b/examples/text/text_input_box.c @@ -25,7 +25,7 @@ int main(void) char name[MAX_INPUT_CHARS + 1] = "\0"; // NOTE: One extra space required for null terminator char '\0' int letterCount = 0; - Rectangle textBox = { screenWidth/2 - 100, 180, 225, 50 }; + Rectangle textBox = { screenWidth/2.0f - 100, 180, 225, 50 }; bool mouseOnText = false; int framesCounter = 0; @@ -85,10 +85,10 @@ int main(void) DrawText("PLACE MOUSE OVER INPUT BOX!", 240, 140, 20, GRAY); DrawRectangleRec(textBox, LIGHTGRAY); - if (mouseOnText) DrawRectangleLines(textBox.x, textBox.y, textBox.width, textBox.height, RED); - else DrawRectangleLines(textBox.x, textBox.y, textBox.width, textBox.height, DARKGRAY); + if (mouseOnText) DrawRectangleLines((int)textBox.x, (int)textBox.y, (int)textBox.width, (int)textBox.height, RED); + else DrawRectangleLines((int)textBox.x, (int)textBox.y, (int)textBox.width, (int)textBox.height, DARKGRAY); - DrawText(name, textBox.x + 5, textBox.y + 8, 40, MAROON); + DrawText(name, (int)textBox.x + 5, (int)textBox.y + 8, 40, MAROON); DrawText(TextFormat("INPUT CHARS: %i/%i", letterCount, MAX_INPUT_CHARS), 315, 250, 20, DARKGRAY); @@ -97,7 +97,7 @@ int main(void) if (letterCount < MAX_INPUT_CHARS) { // Draw blinking underscore char - if (((framesCounter/20)%2) == 0) DrawText("_", textBox.x + 8 + MeasureText(name, 40), textBox.y + 12, 40, MAROON); + if (((framesCounter/20)%2) == 0) DrawText("_", (int)textBox.x + 8 + MeasureText(name, 40), (int)textBox.y + 12, 40, MAROON); } else DrawText("Press BACKSPACE to delete chars...", 230, 300, 20, GRAY); } -- cgit v1.2.3