mirror of
https://github.com/raysan5/raygui.git
synced 2026-01-22 07:09:19 -05:00
Add horizontal scroll (#116)
Add horizontal scroll (Shift + Mouse wheel) for Scroll Panel control
This commit is contained in:
@ -896,7 +896,11 @@ Rectangle GuiScrollPanel(Rectangle bounds, Rectangle content, Vector2 *scroll)
|
|||||||
if (IsKeyDown(KEY_UP)) scrollPos.y += GuiGetStyle(SCROLLBAR, SCROLL_SPEED);
|
if (IsKeyDown(KEY_UP)) scrollPos.y += GuiGetStyle(SCROLLBAR, SCROLL_SPEED);
|
||||||
}
|
}
|
||||||
|
|
||||||
scrollPos.y += GetMouseWheelMove()*20;
|
int wheelMove = GetMouseWheelMove();
|
||||||
|
|
||||||
|
// Horizontal scroll (Shift + Mouse wheel)
|
||||||
|
if (hasHorizontalScrollBar && (IsKeyDown(KEY_LEFT_SHIFT) || IsKeyDown(KEY_RIGHT_SHIFT))) scrollPos.x += wheelMove*20;
|
||||||
|
else scrollPos.y += wheelMove*20; // Vertical scroll
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user