From 3f36c2d3f57ffa2bb51919d030b9fe134fb4426f Mon Sep 17 00:00:00 2001 From: Ray Date: Tue, 24 Feb 2026 00:51:20 +0100 Subject: [PATCH] Update raygui.h --- examples/models/raygui.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/examples/models/raygui.h b/examples/models/raygui.h index 42c5ae7bc..3bf7638be 100644 --- a/examples/models/raygui.h +++ b/examples/models/raygui.h @@ -646,6 +646,7 @@ typedef enum { // ProgressBar typedef enum { PROGRESS_PADDING = 16, // ProgressBar internal padding + PROGRESS_SIDE, // ProgressBar increment side: 0-left->right, 1-right-left } GuiProgressBarProperty; // ScrollBar @@ -3522,7 +3523,15 @@ int GuiProgressBar(Rectangle bounds, const char *textLeft, const char *textRight } // Draw slider internal progress bar (depends on state) - GuiDrawRectangle(progress, 0, BLANK, GetColor(GuiGetStyle(PROGRESSBAR, BASE_COLOR_PRESSED))); + if (GuiGetStyle(PROGRESSBAR, PROGRESS_SIDE) == 0) // Left-->Right + { + GuiDrawRectangle(progress, 0, BLANK, GetColor(GuiGetStyle(PROGRESSBAR, BASE_COLOR_PRESSED))); + } + else // Right-->Left + { + progress.x = bounds.x + bounds.width - progress.width - GuiGetStyle(PROGRESSBAR, BORDER_WIDTH); + GuiDrawRectangle(progress, 0, BLANK, GetColor(GuiGetStyle(PROGRESSBAR, BASE_COLOR_PRESSED))); + } } // Draw left/right text if provided