diff options
-rw-r--r-- | src/Chatbar.cpp | 2 | ||||
-rw-r--r-- | src/MessageBoard.cpp | 6 |
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); |