From 7e7dfd227eacaa80b21ca8ed99e8a99ccbd47769 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Mon, 23 Apr 2018 18:49:45 +0200 Subject: Add side bar, make submodule public --- src/MessageBoard.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/MessageBoard.cpp') diff --git a/src/MessageBoard.cpp b/src/MessageBoard.cpp index 0b0e2fe..4cab31d 100644 --- a/src/MessageBoard.cpp +++ b/src/MessageBoard.cpp @@ -93,11 +93,10 @@ namespace dchat } } - void MessageBoard::draw(sf::RenderWindow &window, Cache &cache) + void MessageBoard::draw(sf::RenderWindow &window, const sf::Vector2f &pos, Cache &cache) { auto windowSize = window.getSize(); - sf::Vector2u backgroundSize(floor(windowSize.x * 0.7f), floor(windowSize.y)); - sf::Vector2f backgroundPos(floor(windowSize.x * 0.5f - backgroundSize.x * 0.5f), 0.0f); + sf::Vector2u backgroundSize(floor(windowSize.x - pos.x * 2.0f), floor(windowSize.y)); //if(backgroundSize != staticContentTexture.getSize()) // updateStaticContentTexture(backgroundSize); @@ -117,7 +116,8 @@ namespace dchat if(dirty) { - sf::Vector2f position = backgroundPos; + sf::Vector2f position = pos; + position.x += 20.0f; position.y += scroll; for(Message *message : messages) { -- cgit v1.2.3