diff options
author | dec05eba <dec05eba@protonmail.com> | 2022-12-03 06:03:43 +0100 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2022-12-03 06:03:57 +0100 |
commit | 32b2c9a53901afbaf41274a173d140bee9b5db90 (patch) | |
tree | 7063c53d4f3e2b5232e9cf8cb5afc645d0c867cb /src | |
parent | 3aacdd395f20fa182413be92a49cbd5c5a780ab9 (diff) |
Add temporary workaround for body getting scrolled when the first item can be visible (but only if body items doesn't fill the whole body)
Diffstat (limited to 'src')
-rw-r--r-- | src/Body.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/Body.cpp b/src/Body.cpp index 505db2b..7050d7d 100644 --- a/src/Body.cpp +++ b/src/Body.cpp @@ -1202,6 +1202,11 @@ namespace QuickMedia { } } + // TODO: This is a temporary workaround for page getting scrolled when the first item can be visible while also showing + // the selected item. This should be replaced with a proper solution once the rendering code has been rewritten. + if(attach_side == AttachSide::TOP && pos.y + std::abs(page_scroll) < size.y) + page_scroll = 0.0; + for(RenderItem &render_item : render_items) { if(render_item.item_index == selected_item) { float offset_y_spacing = -body_spacing[body_theme].spacing_y; |