diff options
Diffstat (limited to 'src/gui/ScrollablePage.cpp')
-rw-r--r-- | src/gui/ScrollablePage.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/gui/ScrollablePage.cpp b/src/gui/ScrollablePage.cpp index 2c1143a..a0977ce 100644 --- a/src/gui/ScrollablePage.cpp +++ b/src/gui/ScrollablePage.cpp @@ -57,7 +57,7 @@ namespace gsr { mgl_scissor prev_scissor; mgl_window_get_scissor(window.internal_window(), &prev_scissor); - const mgl::vec2f content_size = get_size(); + const mgl::vec2f content_size = get_inner_size(); mgl_scissor new_scissor = { mgl_vec2i{(int)offset.x, (int)offset.y}, mgl_vec2i{(int)content_size.x, (int)content_size.y} @@ -81,6 +81,13 @@ namespace gsr { if(!visible) return {0.0f, 0.0f}; + return size; + } + + mgl::vec2f ScrollablePage::get_inner_size() { + if(!visible) + return {0.0f, 0.0f}; + const int margin_top = margin_top_scale * get_theme().window_height; const int margin_bottom = margin_bottom_scale * get_theme().window_height; const int margin_left = margin_left_scale * get_theme().window_height; |