From b69bc964dd6053d9a20803f79a2dfcb7a51dc83a Mon Sep 17 00:00:00 2001 From: dec05eba Date: Wed, 12 May 2021 14:51:41 +0200 Subject: Once upon a time there was a turtle. The turtle was retarded and didn't know what he does. That turtle was me --- include/Body.hpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/Body.hpp b/include/Body.hpp index 3d8167a..48eb45f 100644 --- a/include/Body.hpp +++ b/include/Body.hpp @@ -154,8 +154,6 @@ namespace QuickMedia { sf::Vector2i thumbnail_size; std::vector reactions; // TODO: Move to a different body item type std::shared_ptr extra; // TODO: Remove - - float calculated_height = -1.0f; private: // TODO: Clean up these strings when set in text, and get_title for example should return |title_text.getString()| // TODO: Use sf::String instead, removes the need to convert to utf32 every time the text is dirty (for example when resizing window) @@ -272,8 +270,12 @@ namespace QuickMedia { void update_dirty_state(BodyItem *body_item, float width); void clear_body_item_cache(BodyItem *body_item); sf::Vector2i get_item_thumbnail_size(BodyItem *item) const; - BodyItem* get_previous_visible_item(int start_index); - BodyItem* get_next_visible_item(int start_index); + // Returns -1 if not found + int get_previous_visible_item(int start_index); + // Returns -1 if not found + int get_next_visible_item(int start_index); + float get_offset_to_first_visible_item(sf::Vector2f body_size); + float get_offset_to_last_visible_item(sf::Vector2f body_size); private: Program *program; std::unordered_map> item_thumbnail_textures; -- cgit v1.2.3