Skip to content

Commit 3f36c2d

Browse files
committed
Update raygui.h
1 parent 43d8933 commit 3f36c2d

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

examples/models/raygui.h

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -646,6 +646,7 @@ typedef enum {
646646
// ProgressBar
647647
typedef enum {
648648
PROGRESS_PADDING = 16, // ProgressBar internal padding
649+
PROGRESS_SIDE, // ProgressBar increment side: 0-left->right, 1-right-left
649650
} GuiProgressBarProperty;
650651

651652
// ScrollBar
@@ -3522,7 +3523,15 @@ int GuiProgressBar(Rectangle bounds, const char *textLeft, const char *textRight
35223523
}
35233524

35243525
// Draw slider internal progress bar (depends on state)
3525-
GuiDrawRectangle(progress, 0, BLANK, GetColor(GuiGetStyle(PROGRESSBAR, BASE_COLOR_PRESSED)));
3526+
if (GuiGetStyle(PROGRESSBAR, PROGRESS_SIDE) == 0) // Left-->Right
3527+
{
3528+
GuiDrawRectangle(progress, 0, BLANK, GetColor(GuiGetStyle(PROGRESSBAR, BASE_COLOR_PRESSED)));
3529+
}
3530+
else // Right-->Left
3531+
{
3532+
progress.x = bounds.x + bounds.width - progress.width - GuiGetStyle(PROGRESSBAR, BORDER_WIDTH);
3533+
GuiDrawRectangle(progress, 0, BLANK, GetColor(GuiGetStyle(PROGRESSBAR, BASE_COLOR_PRESSED)));
3534+
}
35263535
}
35273536

35283537
// Draw left/right text if provided

0 commit comments

Comments
 (0)