From 32b2c9a53901afbaf41274a173d140bee9b5db90 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sat, 3 Dec 2022 06:03:43 +0100 Subject: 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) --- src/Body.cpp | 5 +++++ 1 file changed, 5 insertions(+) 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; -- cgit v1.2.3