#pragma once
#include "node_border.h"

class NodeScroll : public NodeBorder
{
    bool m_dragging = false;
    float m_scroll_dir = 1.f;
    glm::vec2 m_drag_start = glm::vec2(0);
    glm::vec2 m_offset_start = glm::vec2(0);
    glm::vec2 m_offset = glm::vec2(0);
    glm::vec2 m_mask = glm::vec2(1, 0);
public:
    NodeScroll();
    virtual Node* clone_instantiate() const override;
    virtual kEventResult handle_event(Event* e) override;
    virtual void draw() override;
    virtual void on_tick(float dt) override;
    void fix_scroll();
};
