Do not force GuiScrollPanel() up/down key inputs

This commit is contained in:
Ray 2022-05-04 11:53:06 +02:00
parent 865bb29376
commit f13c5c3ec3

View File

@ -1523,6 +1523,7 @@ Rectangle GuiScrollPanel(Rectangle bounds, const char *text, Rectangle content,
if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) state = GUI_STATE_PRESSED; if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) state = GUI_STATE_PRESSED;
else state = GUI_STATE_FOCUSED; else state = GUI_STATE_FOCUSED;
#if defined(SUPPORT_SCROLLBAR_KEY_INPUT)
if (hasHorizontalScrollBar) if (hasHorizontalScrollBar)
{ {
if (IsKeyDown(KEY_RIGHT)) scrollPos.x -= GuiGetStyle(SCROLLBAR, SCROLL_SPEED); if (IsKeyDown(KEY_RIGHT)) scrollPos.x -= GuiGetStyle(SCROLLBAR, SCROLL_SPEED);
@ -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_DOWN)) scrollPos.y -= GuiGetStyle(SCROLLBAR, SCROLL_SPEED);
if (IsKeyDown(KEY_UP)) scrollPos.y += GuiGetStyle(SCROLLBAR, SCROLL_SPEED); if (IsKeyDown(KEY_UP)) scrollPos.y += GuiGetStyle(SCROLLBAR, SCROLL_SPEED);
} }
#endif
float wheelMove = GetMouseWheelMove(); float wheelMove = GetMouseWheelMove();
// Horizontal scroll (Shift + Mouse wheel) // Horizontal scroll (Shift + Mouse wheel)