diff options
Diffstat (limited to 'src/gui/StaticPage.cpp')
-rw-r--r-- | src/gui/StaticPage.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/gui/StaticPage.cpp b/src/gui/StaticPage.cpp index a6d9b64..73adfa0 100644 --- a/src/gui/StaticPage.cpp +++ b/src/gui/StaticPage.cpp @@ -6,6 +6,9 @@ namespace gsr { StaticPage::StaticPage(mgl::vec2f size) : size(size) {} bool StaticPage::on_event(mgl::Event &event, mgl::Window &window, mgl::vec2f offset) { + if(!visible) + return true; + const mgl::vec2f draw_pos = position + offset; offset = draw_pos; Widget *selected_widget = selected_child_widget; @@ -27,6 +30,9 @@ namespace gsr { } void StaticPage::draw(mgl::Window &window, mgl::vec2f offset) { + if(!visible) + return; + const mgl::vec2f draw_pos = position + offset; offset = draw_pos; Widget *selected_widget = selected_child_widget; @@ -50,4 +56,11 @@ namespace gsr { mgl_window_set_scissor(window.internal_window(), &prev_scissor); } + + mgl::vec2f StaticPage::get_size() { + if(!visible) + return {0.0f, 0.0f}; + + return size; + } }
\ No newline at end of file |