diff options
Diffstat (limited to 'src/Body.cpp')
-rw-r--r-- | src/Body.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/Body.cpp b/src/Body.cpp index a1eb592..bc56ef8 100644 --- a/src/Body.cpp +++ b/src/Body.cpp @@ -218,12 +218,12 @@ namespace QuickMedia { return -1; } - void Body::select_first_item() { + void Body::select_first_item(bool reset_page_scroll) { selected_item = 0; - //if(attach_side == AttachSide::TOP) { - // prev_selected_item = selected_item; - // page_scroll = 0.0f; - //} + if(attach_side == AttachSide::TOP && reset_page_scroll) { + prev_selected_item = selected_item; + page_scroll = 0.0f; + } clamp_selection(); } @@ -355,7 +355,7 @@ namespace QuickMedia { return true; } else if(event.key.code == sf::Keyboard::Home) { render_selected_item_bg = true; - select_first_item(); + select_first_item(false); if(on_top_reached) on_top_reached(); return true; @@ -1058,6 +1058,7 @@ namespace QuickMedia { } } else if(item->thumbnail_size.x > 0) { text_offset_x += image_padding_x + content_size.x; + // TODO: Fix. This makes the body item have incorrect position when loading and if the item is merge_with_previous? and has an embedded item //if(!merge_with_previous) // image_height = content_size.y; } |