From b0bfb8b8d1479502bd5adf17e6a1b94ec00c63ca Mon Sep 17 00:00:00 2001 From: dec05eba Date: Mon, 23 Apr 2018 20:21:11 +0200 Subject: Fix issue where text is not visible if window is too small, set window minimum size --- src/Text.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/Text.cpp') diff --git a/src/Text.cpp b/src/Text.cpp index fc3effe..fa46277 100644 --- a/src/Text.cpp +++ b/src/Text.cpp @@ -318,7 +318,11 @@ namespace dchat pos.y += floor(vspace); // Origin is at bottom left, we want it to be at top left // TODO: Do not use maxWidth here. Max width might be set to 99999 and actual text width might be 200. Text width should be calculated instead - if(pos.x + maxWidth <= 0.0f || pos.x >= maxWidth || pos.y + totalHeight <= 0.0f || pos.y >= target.getSize().y) return; + //sf::FloatRect targetRect(0.0f, 0.0f, maxWidth, target.getSize().y); + //sf::FloatRect textRect(pos.x, pos.y, maxWidth, ) + //colRect.contains() + //if(pos.x + maxWidth <= 0.0f || pos.x >= maxWidth || pos.y + totalHeight <= 0.0f || pos.y >= target.getSize().y) return; + if(pos.y + totalHeight <= 0.0f || pos.y >= target.getSize().y) return; states.transform.translate(pos); states.texture = &font.getTexture(characterSize); -- cgit v1.2.3