aboutsummaryrefslogtreecommitdiff
path: root/src/Text.cpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2018-04-23 20:21:11 +0200
committerdec05eba <dec05eba@protonmail.com>2018-04-23 20:21:17 +0200
commitb0bfb8b8d1479502bd5adf17e6a1b94ec00c63ca (patch)
tree8c8471f9c03f602f32ce0c9ba7dcd7a2caec1f6c /src/Text.cpp
parent39936316f2f080bd216abd9ed49d36ba1006854d (diff)
Fix issue where text is not visible if window is too small, set window minimum size
Diffstat (limited to 'src/Text.cpp')
-rw-r--r--src/Text.cpp6
1 files changed, 5 insertions, 1 deletions
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);