diff options
Diffstat (limited to 'src/ChannelSidePanel.cpp')
-rw-r--r-- | src/ChannelSidePanel.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
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<Channel*> channels; + static vector<Channel*> 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; + } } |