diff options
author | dec05eba <dec05eba@protonmail.com> | 2021-05-12 14:51:41 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2021-05-12 14:51:41 +0200 |
commit | b69bc964dd6053d9a20803f79a2dfcb7a51dc83a (patch) | |
tree | 9ab07073cb87373681d1bb6b85323320d57927a3 /include | |
parent | f1063e25a55aec5a8f7b294d0392dd31d5bf9813 (diff) |
Once upon a time there was a turtle. The turtle was retarded and didn't know what he does. That turtle was me
Diffstat (limited to 'include')
-rw-r--r-- | include/Body.hpp | 10 |
1 files changed, 6 insertions, 4 deletions
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<Reaction> reactions; // TODO: Move to a different body item type std::shared_ptr<BodyItemExtra> 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<std::string, std::shared_ptr<ThumbnailData>> item_thumbnail_textures; |