feat: horizontal scroll

This commit is contained in:
MihailRis 2026-08-07 22:26:58 +03:00
parent 2448869bf9
commit 863cc923a0
4 changed files with 26 additions and 19 deletions

View file

@ -13,10 +13,12 @@ namespace gui {
protected:
std::vector<std::shared_ptr<UINode>> nodes;
std::vector<IntervalEvent> intervalEvents;
int scroll = 0;
int scrollY = 0;
int scrollX = 0;
int scrollStep = 40;
int scrollBarWidth = 10;
int actualLength = 0;
int actualLengthY = 0;
int actualLengthX = 0;
bool scrollable = true;
bool isScrolling() const {
@ -40,7 +42,7 @@ namespace gui {
virtual void setScrollable(bool flag);
void listenInterval(float interval, OnTimeOut callback, int repeat=-1);
virtual glm::vec2 getContentOffset() const override {
return glm::vec2(0.0f, scroll);
return glm::vec2(scrollX, scrollY);
};
virtual void setSize(const glm::vec2& size) override;
virtual int getScrollStep() const;