#pragma once
#include "node_border.h"

class NodeColorQuad : public NodeBorder
{
    NodeBorder* m_picker{nullptr};
    bool dragging = false;
public:
    glm::vec2 m_value{0.f};
    glm::vec2 m_old_value{0.f};
    std::function<void(Node* target, glm::vec2 value)> on_value_changed;
    virtual Node* clone_instantiate() const override;
    virtual void clone_finalize(Node* dest) const override;
    virtual void init() override;
    void set_value(float x, float y);
    virtual kEventResult handle_event(Event* e) override;
    virtual void draw() override;
};
