From 4c392178dac1de9a299beb78989c4e0f3fecade9 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sun, 20 May 2018 11:15:15 +0200 Subject: Add image preview and url/image open in browser --- include/Text.hpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'include/Text.hpp') diff --git a/include/Text.hpp b/include/Text.hpp index d7d1e06..925dc94 100644 --- a/include/Text.hpp +++ b/include/Text.hpp @@ -57,10 +57,13 @@ namespace dchat // Warning: won't update until @draw is called float getHeight() const; - void processEvent(const sf::Event &event); + void processEvent(const sf::Event &event, Cache &cache); - // Performs culling. @updateGeometry is called even if text is not visible if text is dirty, because updateGeometry might change the dimension of the text and make is visible - void draw(sf::RenderTarget &target, Cache &cache); + // Performs culling. @updateGeometry is called even if text is not visible if text is dirty, because updateGeometry might change the dimension of the text and make is visible. + // Returns true if text was drawn on screen (if text is within window borders) + bool draw(sf::RenderTarget &target, Cache &cache); + private: + void onMouseClick(const sf::Event::MouseButtonEvent &event, Cache &cache); private: enum class CaretMoveDirection : u8 { -- cgit v1.2.3