added indent

This commit is contained in:
RobinsAviary 2025-10-02 18:01:10 -04:00
parent 353814550e
commit b2c48cd5d4

View File

@ -76,25 +76,25 @@ int main(void)
// Most operating systems hide this information until the user presses Ctrl-V on the window. // Most operating systems hide this information until the user presses Ctrl-V on the window.
// Check to see if the clipboard contains an image // Check to see if the clipboard contains an image
// This function does nothing outside of Windows, as it directly calls the Windows API // This function does nothing outside of Windows, as it directly calls the Windows API
Image image = GetClipboardImage(); Image image = GetClipboardImage();
if (IsImageValid(image)) if (IsImageValid(image))
{ {
// Unload the image // Unload the image
UnloadImage(image); UnloadImage(image);
// Update visuals // Update visuals
popupText = "clipboard contains image"; popupText = "clipboard contains image";
} }
else else
{ {
// Get text from the user's clipboard // Get text from the user's clipboard
clipboardText = GetClipboardText(); clipboardText = GetClipboardText();
// Update visuals // Update visuals
popupText = "text pasted"; popupText = "text pasted";
pasteAnim = animMaxTime; pasteAnim = animMaxTime;
} }
// Reset animation values // Reset animation values
textTimer = maxTime; textTimer = maxTime;
@ -157,43 +157,43 @@ int main(void)
//---------------------------------------------------------------------------------- //----------------------------------------------------------------------------------
BeginDrawing(); BeginDrawing();
ClearBackground(RAYWHITE); ClearBackground(RAYWHITE);
// Draw the user's pasted text, if there is any yet // Draw the user's pasted text, if there is any yet
if (clipboardText) if (clipboardText)
{ {
// Offset animation // Offset animation
int offset = 0; int offset = 0;
if (pasteAnim > 0) offset = offsetAmount; if (pasteAnim > 0) offset = offsetAmount;
// Draw the pasted text // Draw the pasted text
DrawText("pasted clipboard:", 10, 10 + offset, 20, DARKGREEN); DrawText("pasted clipboard:", 10, 10 + offset, 20, DARKGREEN);
DrawText(clipboardText, 10, 30 + offset, 20, DARKGRAY); DrawText(clipboardText, 10, 30 + offset, 20, DARKGRAY);
} }
// Offset animation // Offset animation
int textOffset = 0; int textOffset = 0;
if (copyAnim > 0) textOffset = offsetAmount; if (copyAnim > 0) textOffset = offsetAmount;
// Draw copyable text and controls // Draw copyable text and controls
DrawText(copyableText[textIndex], 10, 330 + (textOffset * copyAnimMult), 20, MAROON); DrawText(copyableText[textIndex], 10, 330 + (textOffset * copyAnimMult), 20, MAROON);
DrawText("up/down to change string, ctrl-c to copy, ctrl-v to paste", 10, 355, 20, DARKGRAY); DrawText("up/down to change string, ctrl-c to copy, ctrl-v to paste", 10, 355, 20, DARKGRAY);
// Alpha / Offset animation // Alpha / Offset animation
if (textAlpha > 0) if (textAlpha > 0)
{ {
// Offset animation // Offset animation
int offset = 0; int offset = 0;
if (textAnim > 0) offset = offsetAmount; if (textAnim > 0) offset = offsetAmount;
// Draw pop up text // Draw pop up text
DrawText(popupText, 10, 425 + offset, 20, ColorAlpha(DARKGREEN, textAlpha)); DrawText(popupText, 10, 425 + offset, 20, ColorAlpha(DARKGREEN, textAlpha));
// Fade-out animation // Fade-out animation
if (textTimer < 0) if (textTimer < 0)
{ {
textAlpha -= GetFrameTime(); textAlpha -= GetFrameTime();
} }
} }
EndDrawing(); EndDrawing();
//---------------------------------------------------------------------------------- //----------------------------------------------------------------------------------