Skip to content

Commit

Permalink
Do not force GuiScrollPanel() up/down key inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
raysan5 committed May 4, 2022
1 parent 865bb29 commit f13c5c3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/raygui.h
Original file line number Diff line number Diff line change
Expand Up @@ -1523,6 +1523,7 @@ Rectangle GuiScrollPanel(Rectangle bounds, const char *text, Rectangle content,
if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) state = GUI_STATE_PRESSED;
else state = GUI_STATE_FOCUSED;

#if defined(SUPPORT_SCROLLBAR_KEY_INPUT)
if (hasHorizontalScrollBar)
{
if (IsKeyDown(KEY_RIGHT)) scrollPos.x -= GuiGetStyle(SCROLLBAR, SCROLL_SPEED);
Expand All @@ -1534,7 +1535,7 @@ Rectangle GuiScrollPanel(Rectangle bounds, const char *text, Rectangle content,
if (IsKeyDown(KEY_DOWN)) scrollPos.y -= GuiGetStyle(SCROLLBAR, SCROLL_SPEED);
if (IsKeyDown(KEY_UP)) scrollPos.y += GuiGetStyle(SCROLLBAR, SCROLL_SPEED);
}

#endif
float wheelMove = GetMouseWheelMove();

// Horizontal scroll (Shift + Mouse wheel)
Expand Down

0 comments on commit f13c5c3

Please sign in to comment.