From 4aac8df198e3a5bd9c6efc95cdf4c520c2e05401 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sat, 30 Mar 2019 19:09:23 +0100 Subject: Move users to left side --- src/ChannelSidePanel.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/ChannelSidePanel.cpp') diff --git a/src/ChannelSidePanel.cpp b/src/ChannelSidePanel.cpp index 524e504..49407cc 100644 --- a/src/ChannelSidePanel.cpp +++ b/src/ChannelSidePanel.cpp @@ -13,7 +13,8 @@ using namespace std; namespace dchat { - vector channels; + static vector channels; + static sf::Vector2f position; const float WIDTH = 300.0f; const unsigned int FONT_SIZE = 20; const float PADDING_BOTTOM = 10.0f; @@ -45,7 +46,7 @@ namespace dchat auto mousePos = sf::Mouse::getPosition(window); - sf::Vector2f position(10.0f, posY); + position.y = posY; for(Channel *channel : channels) { sf::FloatRect box(0.0f, position.y, getWidth(), channelBoxHeight); @@ -84,4 +85,9 @@ namespace dchat { return floor(WIDTH * Settings::getScaling()); } + + float ChannelSidePanel::getHeight() + { + return position.y; + } } -- cgit v1.2.3