diff options
author | dec05eba <dec05eba@protonmail.com> | 2024-08-01 22:19:59 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2024-08-01 22:22:45 +0200 |
commit | 10a5669330ba978c37d984a312ba1de7a2542503 (patch) | |
tree | 0ff8cc9660841ce3979ad87da954fb7e14de7d16 /include/gui/Widget.hpp | |
parent | 67216467d4dc43134a07f7f843a80a1adf688acd (diff) |
Draw and event position relative to parent (for pages)
Diffstat (limited to 'include/gui/Widget.hpp')
-rw-r--r-- | include/gui/Widget.hpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/include/gui/Widget.hpp b/include/gui/Widget.hpp index 6324490..bd0d5d9 100644 --- a/include/gui/Widget.hpp +++ b/include/gui/Widget.hpp @@ -9,7 +9,8 @@ namespace mgl { namespace gsr { class Widget { - friend class Page; + friend class StaticPage; + friend class ScrollablePage; public: Widget(); Widget(const Widget&) = delete; @@ -17,8 +18,8 @@ namespace gsr { virtual ~Widget(); // Return true to allow other widgets to also process the event - virtual bool on_event(mgl::Event &event, mgl::Window &window) = 0; - virtual void draw(mgl::Window &window) = 0; + virtual bool on_event(mgl::Event &event, mgl::Window &window, mgl::vec2f offset) = 0; + virtual void draw(mgl::Window &window, mgl::vec2f offset) = 0; virtual void set_position(mgl::vec2f position); virtual mgl::vec2f get_position() const; |