aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2018-05-01 16:51:37 +0200
committerdec05eba <dec05eba@protonmail.com>2018-05-01 16:51:42 +0200
commit1e822e1ef0c6184ae02dc804c1ce5c866fad4c7c (patch)
treef040a244eb4f5a97ab7d95e2cf2b2015527fa544
parent90460867d4bff46cca0033c06475ffd2b4ac49b7 (diff)
Increase chatbar font size, remove last line in chat
-rw-r--r--src/Chatbar.cpp2
-rw-r--r--src/MessageBoard.cpp6
2 files changed, 5 insertions, 3 deletions
diff --git a/src/Chatbar.cpp b/src/Chatbar.cpp
index 950734d..7f50153 100644
--- a/src/Chatbar.cpp
+++ b/src/Chatbar.cpp
@@ -14,7 +14,7 @@ using namespace std;
namespace dchat
{
- const float FONT_SIZE = 18;
+ const float FONT_SIZE = 20;
const float BOX_PADDING_X = 15.0f;
const float BOX_PADDING_Y = 5.0f;
const int BLINK_TIME_VISIBLE_MS = 500;
diff --git a/src/MessageBoard.cpp b/src/MessageBoard.cpp
index 6c75399..9dbeb71 100644
--- a/src/MessageBoard.cpp
+++ b/src/MessageBoard.cpp
@@ -174,8 +174,10 @@ namespace dchat
sf::Vector2<double> position(ChannelSidePanel::getWidth(), ChannelTopPanel::getHeight() + PADDING_TOP);
double startHeight = position.y;
position.y += scroll;
- for(Message *message : messages)
+ usize numMessages = messages.size();
+ for(usize i = 0; i < numMessages; ++i)
{
+ Message *message = messages[i];
position.y += (MESSAGE_PADDING_TOP * Settings::getScaling());
if(position.y + usernameTextHeight > 0.0f && position.y < backgroundPos.y + backgroundSize.y)
{
@@ -206,7 +208,7 @@ namespace dchat
message->text.draw(window, cache);
position.y += (message->text.getHeight() + MESSAGE_PADDING_BOTTOM * Settings::getScaling());
- if(position.y + LINE_HEIGHT > 0.0f && position.y < backgroundPos.y + backgroundSize.y)
+ if(position.y + LINE_HEIGHT > 0.0f && position.y < backgroundPos.y + backgroundSize.y && i + 1 != numMessages)
{
lineRect.setPosition(sf::Vector2f(position.x + LINE_SIDE_PADDING, floor(position.y)));
window.draw(lineRect);